@@ -247,12 +247,22 @@ def _ensure_handler():
247
247
248
248
def set_loglevel (level ):
249
249
"""
250
- Set Matplotlib's root logger and root logger handler level, creating
251
- the handler if it does not exist yet.
250
+ Configure Matplotlib's logging levels.
251
+
252
+ Matplotlib uses the standard library `logging` framework under the root
253
+ logger 'matplotlib'. This is a helper function to:
254
+
255
+ - set Matplotlib's root logger level
256
+ - set the root logger handler's level, creating the handler
257
+ if it does not exist yet
252
258
253
259
Typically, one should call ``set_loglevel("info")`` or
254
260
``set_loglevel("debug")`` to get additional debugging information.
255
261
262
+ Users or applications that are installing their own logging handlers
263
+ may want to directly manipulate ``logging.getLogger('matplotlib')`` rather
264
+ than use this function.
265
+
256
266
Parameters
257
267
----------
258
268
level : {"notset", "debug", "info", "warning", "error", "critical"}
@@ -263,6 +273,7 @@ def set_loglevel(level):
263
273
The first time this function is called, an additional handler is attached
264
274
to Matplotlib's root handler; this handler is reused every time and this
265
275
function simply manipulates the logger and handler's level.
276
+
266
277
"""
267
278
_log .setLevel (level .upper ())
268
279
_ensure_handler ().setLevel (level .upper ())
0 commit comments