Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Allow Disabling stderr Output#83

Merged
metachris merged 2 commits intometachris:masterfrom
brianlenz:disable-stderr-logger
Mar 2, 2018
Merged

Allow Disabling stderr Output#83
metachris merged 2 commits intometachris:masterfrom
brianlenz:disable-stderr-logger

Conversation

@brianlenz
Copy link

  • Added the ability to disable stderr output when logging to a file so that you aren't forced to have double-logging.

  • Fixed a minor logic bug with StreamHandler detection. FileHandler extends from StreamHandler so checking if the handler is an instanceof StreamHandler alone isn't sufficient, as it could actually be a FileHandler. Discovered this when running unit tests for the new functionality. Reordered the logic in order to ensure the detected StreamHandler is always the internally-created stderr handler so that it can be disabled properly.

* Added the ability to disable stderr output when logging to a file so that you aren't forced to have double-logging.

* Fixed a minor logic bug with `StreamHandler` detection. `FileHandler` extends from `StreamHandler` so checking if the `handler` is an instanceof `StreamHandler` alone isn't sufficient, as it could actually be a `FileHandler`. Discovered this when running unit tests for the new functionality. Reordered the logic in order to ensure the detected `StreamHandler` is always the internally-created `stderr` handler so that it can be disabled properly.
@metachris
Copy link
Owner

Great, thank you! May I ask that you also add info about the param here: https://github.com/metachris/logzero/blob/master/docs/index.rst

<3

@brianlenz
Copy link
Author

Definitely!

* Added documentation and examples for disabling the default stderr logger.
@metachris metachris merged commit 4dda341 into metachris:master Mar 2, 2018
@metachris
Copy link
Owner

v1.4.0 is on its way

@brianlenz brianlenz deleted the disable-stderr-logger branch March 2, 2018 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants