-1
1. first.py file
import logging
class Log:
def __init__(self,msg):
self.msg = msg
def debug(self,msg):
FORMAT = "%(asctime)-15s%(message)s"
logging.basicConfig(filemode = "w", filename="file.log", format = FORMAT, level=logging.DEBUG)
logging.debug(self.msg)
2. second.py file
import first
first.Log.debug("I am in debug mode")
**에서 메서드를 호출 할 때 디버그 모드에 있습니다. ")형식 오류 : 디버그 (1 개) 필요한 위치 인수 누락 'MSG를'나는 " Logging.Log.debug (나는 오류를 얻고보다 내가 second.py 파일을 실행하면 다른 클래스
TypeError: debug() missing 1 required positional argument: 'msg'**
여기서 내가 잘못한 것을 제안하십시오. 코딩에 익숙하지 않습니다.
의 사용 가능한 복제 [형식 오류 : 누락 한 필요한 위치 인수 : '자기'(http://stackoverflow.com/questions/17534345/typeerror-missing- 1 - 필수 - 위치 인수 - 자기) – Somar