Skip to content

set_loglevel documenation and escape hatch #23681

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

Closed
wants to merge 2 commits into from

Conversation

tacaswell
Copy link
Member

PR Summary

closes #23646

If we want this new flag I'll add a test. I am of two minds on it, we might only want the doc updates.

PR Checklist

Tests and Styling

  • [] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@tacaswell tacaswell added this to the v3.7.0 milestone Aug 19, 2022
Parameters
----------
level : {"notset", "debug", "info", "warning", "error", "critical"}
The log level of the handler.

ensure_handler : bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I am not sure why we would add this. A naive enduser unfamiliar with logging won't know what this means, and a library author familiar with logging should know not to call this, particularly given the change to the docstring above. If we do add this, the docstring below probably needs to be clarified.

Copy link
Contributor

@l-johnston l-johnston Aug 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree; a documentation update should be sufficient:

  • Add a new section for discussion of logging within Matplotlib - the two use cases as a library and as an application
  • End users can call set_level()
  • For library developers, state that Matplotlib is using the standard library logging and its singleton logger is called 'matplotlib' and in their library code get the 'matplotlib' logger and add the desired handler.

@tacaswell tacaswell removed this from the v3.7.0 milestone Oct 20, 2022
@tacaswell
Copy link
Member Author

Consensus is that this is better as just documentation updates.

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

Successfully merging this pull request may close these issues.

[Bug]: matplotlib.set_loglevel() adds a console handler
3 participants