-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
It is customary for Python packages to not set the log levels, but let library users decide which logging to enable.
At least NeMo-text-processing shouldn't override if users have disabled logging from NeMo.
So instead just setting the level to INFO:
NeMo-text-processing/nemo_text_processing/utils/logging.py
Lines 18 to 23 in e15caea
| logger = logging.getLogger("NeMo-text-processing") | |
| c_handler = logging.StreamHandler() | |
| logger.addHandler(c_handler) | |
| logger.setLevel(logging.INFO) | |
| logFormatter = logging.Formatter(fmt=' %(name)s :: %(levelname)-8s :: %(message)s') | |
| c_handler.setFormatter(logFormatter) |
At least it should be:
if logger.level == logging.NOTSET:
logger.setLevel(logging.INFO)
This would honor logging configuration set before the library is loaded to suppress logging output printed during initialization.
Metadata
Metadata
Assignees
Labels
No labels