-
Notifications
You must be signed in to change notification settings - Fork 227
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
Nornir is hijacking logger #230
Comments
Probably not the best implementation but the behavior is intended: https://github.com/nornir-automation/nornir/blob/develop/nornir/core/__init__.py#L110 We should probably call it instead from https://github.com/nornir-automation/nornir/blob/develop/nornir/core/__init__.py#L122 Alternatively, all the parameters you are trying to set are actually supported by the configuration so it should be quite straightforward to configure all that. |
I am failing to understand how this behavior is intended. Currently I have found the following workaround - branch my loggers with different root:
and then use it like this:
But I don't like it - I need to explicitly name the logger for my app instead of using the root logger, I can't use |
Well, I am open for suggestions here and PRs are welcome. As long as |
@dbarrosop could you describe the requirements for the logging? What is the desired behavior? I will try evaluating possible designs to implement this. |
Basically what these options describe: https://github.com/nornir-automation/nornir/blob/develop/nornir/core/configuration.py#L52-L80 Simplest solution, if you don't come up with anything smarter, might be to have a |
How can a user currently call logging? |
no, that's not intended. The correct behavior should be with |
if the user needs to call |
Not sure how they are related, in any case, the "nornir" logger is meant to be for the library. Not for the users code. It is the best place to look for errors and to try to see what's going on. I understand current implementation is a bit messy, that's why I think we should move it outsode the |
Fix nornir-automation#230 * Logging is configured inside InitNornir * Remove logging_dictConfig, logging_loggers configuration parameters * Add logging_enabled configuration parameter * Logging is configured only if a user didn't configure nornir logger * Logging configuration is using only programmatic way * Remove all previous logging configuration
Fix nornir-automation#230 * Logging is configured inside InitNornir * Remove logging_dictConfig, logging_loggers configuration parameters * Add logging_enabled configuration parameter * Logging is configured only if a user didn't configure nornir logger * Logging configuration is using only programmatic way * Remove all previous logging configuration
Fix nornir-automation#302, nornir-automation#230 * Nornir logging is configured only when no changes have been done to Python logging * No more duplicate logs * Replace format and f-strings in logs to % strings according to best practices * Improved messages for some logs
Fix nornir-automation#302, nornir-automation#230 * Nornir logging is configured only when no changes have been done to Python logging * No more duplicate logs * Replace format and f-strings in logs to % strings according to best practices * Improved messages for some logs
Fix nornir-automation#302, nornir-automation#230 * Nornir logging is configured only when no changes have been done to Python logging * No more duplicate logs * Replace format and f-strings in logs to % strings according to best practices * Improved messages for some logs
* Improve logging Fix #302, #230 * Nornir logging is configured only when no changes have been done to Python logging * No more duplicate logs * Replace format and f-strings in logs to % strings according to best practices * Improved messages for some logs * Fix build errors * Add .ipynb_checkpoints to sphinx ignored list * Run black and pylama on specific folders * Pin pydantic until 0.19.0 is released pydantic/pydantic#254 * Add backwards compatibility and address comments * Fix handling_connections notebook validation * Add nbval sanitization to Makefile
Fixed with #316 |
Even after 6 years python logging is still a mystery to me, so I'd greatly appreciate if someone could help with triage and fixing the issue.
The text was updated successfully, but these errors were encountered: