0

I would like to suppress specific INFO output:

INFO Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting. 

I know that warnings can be suppressed, see warnings — Warning control, but it does not seem to be applicable. The question is general and should not depend on the context, in that case messing up with matplotlib and can avoid it by using another way.

2
  • 1
    Yes, you should configure your logger to a log level higher than INFO, e.g. WARNING or ERROR. How you do that depends on the logging framework, the logger setup, etc. Commented Jun 24, 2022 at 10:52
  • Yes, full solution found here in the case of matplotlib. Commented Jun 24, 2022 at 12:28

1 Answer 1

1

I've had the same issue. I used logging in my own terms and set it to DEBUG for development reasons.

I also used matplotlib and it just took my debug level definition and I started to see a whole lot of debug messages which were not mine.

My best guess would be to import logging and setting the log level higher than info.

Sign up to request clarification or add additional context in comments.

6 Comments

Do you mean like this: logging.basicConfig(level=logging.DEBUG)? It did not work, but I do not understand the logging package in detail.
Yes. But setting it to DEBUG is a higher logging level. You have to set it lower than INFO, like WARNING or ERROR. This makes the filter more restrictive. Then it should be fine.
This worked: logging.basicConfig(level="INFO") mlogger = logging.getLogger("matplotlib") mlogger.setLevel(logging.WARNING)
Solution found here.
Did not work for me without the matplotlib specification.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.