-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Description
Hello, I've noticed that simply importing neural_compressor causes issues with the root logger. It changes the logging level from the default WARNING to INFO, and this is not a good behaviour because it can change the logging level of the loggers of other imported libraries, letting them print all the INFO stuff that sometimes can be a bit too much. Generally the good practice would be to use a named logger (for example logger=logging.getLogger("neural_compressor")
) and not the root one, so that when you set its level you don't change te default level of all the loggers. You can reproduce the issue with this small code snippet:
import logging
print(logging.getLogger())
import neural_compressor
print(logging.getLogger())
The output will be:
<RootLogger root (WARNING)>
2022-10-29 07:43:46 [INFO] NumExpr defaulting to 2 threads.
2022-10-29 07:43:49 [INFO] Generating grammar tables from /usr/lib/python3.7/lib2to3/Grammar.txt
2022-10-29 07:43:49 [INFO] Generating grammar tables from /usr/lib/python3.7/lib2to3/PatternGrammar.txt
<RootLogger root (INFO)>
Metadata
Metadata
Assignees
Labels
No labels