????python????logging????????logging?????????????

def logTest():
import logging
import os
logger=logging.getLogger()
handler=logging.FileHandler(os.path.join(os.getcwd()??"test.log"))
formater=logging.Formatter("%(asctime)s %(levelname)s %(message)s")
handler.setFormatter(formater)
logger.addHandler(handler)
logger.setLevel(logging.NOTSET)
logger.debug("???????log????")
return

????logging.getLogger()
??????????????????
????logging.FileHandler(logfile)
????????????????????????????????????
????logging.Formatter()
????????????
????setFormatter()
????????????????????????????????????????
????addHandler()
????????????????????????????????????????
????setLevel()
???????????????