logger issue
LayTonQ opened this issue · 0 comments
LayTonQ commented
When i import my logging, and use it , it will output two lines log, one of the log is not my expect.
The code is
>>> import pywifi
>>> import logging
>>> logger = logging.getLogger("tmp")
>>> logger.setLevel(logging.DEBUG)
>>> LOG_FORMAT = "%(asctime)s %(levelname)s %(funcName)s_%(lineno)d: %(message)s"
>>> format = logging.Formatter(LOG_FORMAT)
>>> ch = logging.StreamHandler()
>>> ch.setLevel(logging.DEBUG)
>>> ch.setFormatter(format)
>>> logger.addHandler(ch)
>>> logger.info("aaa")
2024-03-15 15:27:10,170 INFO <module>_1: aaa
tmp 2024-03-15 15:27:10,170 INFO aaa
I check the code , your logging setting the basicConfig
Could you please modify the code, then your logger only output your log?