8000 [MNT]: User feedback should use warnings, not logs · Issue #23422 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[MNT]: User feedback should use warnings, not logs #23422
Open
@mwaskom

Description

@mwaskom

Summary

There are at least two places where matplotlib provides a message to the user about usage patterns that are potentially mistakes using logging functionality, rather than as a warning.

Two examples I've encountered recently:

I don't think logging is the right mechanism here:

  • The feedback provides very little information about the source of the problem, you just get some text in stderr.
  • Related, you can convert a warning to an error and then drop into a debugger to figure out what's happening; I don't think that's the case with logging?
  • Warnings can be intercepted by third party libraries that are doing something on purpose (i.e., passing numbers-as-strings to use a categorical axis), whereas logs are harder to muffle without intervening.

Proposed fix

It's possible I am wrong here, but warnings.warn feels like the right mechanism for both of these pieces of feedback.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0