Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger issue #81

Open
LayTonQ opened this issue Mar 15, 2024 · 0 comments
Open

logger issue #81

LayTonQ opened this issue Mar 15, 2024 · 0 comments

Comments

@LayTonQ
Copy link

LayTonQ commented Mar 15, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant