@@ -440,11 +440,13 @@ or manually with ::
440
440
logging.basicConfig(level=logging.DEBUG)
441
441
import matplotlib.pyplot as plt
442
442
443
- Then they will receive messages like::
443
+ Then they will receive messages like
444
444
445
- DEBUG:matplotlib.backends:backend MacOSX version unknown
446
- DEBUG:matplotlib.yourmodulename:Here is some information
447
- DEBUG:matplotlib.yourmodulename:Here is some more detailed information
445
+ .. code-block :: none
446
+
447
+ DEBUG:matplotlib.backends:backend MacOSX version unknown
448
+ DEBUG:matplotlib.yourmodulename:Here is some information
449
+ DEBUG:matplotlib.yourmodulename:Here is some more detailed information
448
450
449
451
Which logging level to use?
450
452
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -489,12 +491,10 @@ Matplotlib. For example, for the module::
489
491
if bottom == top:
490
492
warnings.warn('Attempting to set identical bottom==top')
491
493
492
-
493
494
running the script::
494
495
495
496
from matplotlib import my_matplotlib_module
496
- my_matplotlib_module.set_range(0, 0) #set range
497
-
497
+ my_matplotlib_module.set_range(0, 0) # set range
498
498
499
499
will display::
500
500
@@ -509,10 +509,12 @@ Modifying the module to use `._api.warn_external`::
509
509
if bottom == top:
510
510
_api.warn_external('Attempting to set identical bottom==top')
511
511
512
- and running the same script will display::
512
+ and running the same script will display
513
+
514
+ .. code-block :: none
513
515
514
- UserWarning: Attempting to set identical bottom==top
515
- my_matplotlib_module.set_range(0, 0) #set range
516
+ UserWarning: Attempting to set identical bottom==top
517
+ my_matplotlib_module.set_range(0, 0) # set range
516
518
517
519
.. _logging tutorial : https://docs.python.org/3/howto/logging.html#logging-basic-tutorial
518
520
0 commit comments