awkman / pywifi

A cross-platform module for manipulating WiFi devices.
MIT License
453 stars 154 forks source link

logger issue #81

Open LayTonQ opened 8 months ago

LayTonQ commented 8 months ago

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 image

Could you please modify the code, then your logger only output your log?