8000 DOC: add whats new and update FAQs · matplotlib/matplotlib@d5dc75e · GitHub
[go: up one dir, main page]

Skip to content

Commit d5dc75e

Browse files
committed
DOC: add whats new and update FAQs
1 parent d738837 commit d5dc75e

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

doc/devel/contributing.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,11 @@ Then they will receive messages like::
448448
matplotlib.yourmodulename: 347 - INFO - Here is some information
449449
matplotlib.yourmodulename: 348 - DEBUG - Here is some more detailed information
450450

451+
More straight forward helper methods are available to end-users as well::
452+
453+
import matplotlib.pyplot as plt
454+
plt.verbose() # or plt.debug()
455+
451456
Which logging level to use?
452457
~~~~~~~~~~~~~~~~~~~~~~~~~~~
453458

doc/faq/troubleshooting_faq.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,16 @@ provide the following information in your e-mail to the `mailing list
120120

121121
python -c "from logging import *; basicConfig(level=DEBUG); from pylab import *; plot(); show()"
122122

123+
If you want to trigger logging in a script, it can be done with helper
124+
functions::
123125

124-
If you want to put the debugging hooks in your own code, then the
125-
most simple way to do so is to insert the following *before* any calls
126-
to ``import matplotlib``::
126+
import matplotlib.pyplot as plt
127+
plt.verbose() # or plt.debug()
128+
129+
130+
If you want to put full debugging hooks in your own code, including
131+
debug information when matplotlib starts up, then the way to do so is to
132+
insert the following *before* any calls to ``import matplotlib``::
127133

128134
import logging
129135
logging.basicConfig(level=logging.DEBUG)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:orphan:
2+
3+
New methods for verbose logging
4+
-------------------------------
5+
6+
If more debugging information is required, the user can call
7+
the `.pyplot.verbose` or `.pyplot.debug` methods.

lib/matplotlib/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ def _check_versions():
207207
sys.argv = ['modpython']
208208

209209

210-
def verbose(level='debug'):
210+
def verbose(level='info'):
211211
"""
212212
Shortcut to set the debugging level of the logging module.
213213
214214
Parameters
215215
----------
216216
level : str or bool
217-
If True set logging level to "DEBUG" for matplotlib module.
217+
If True set logging level to "INFO" for matplotlib module.
218218
If FALSE set logging level to "WARNING" for matplotlib module (this
219219
is the default level if ``verbose`` is not called). If a string, must
220220
be one of ['warning', 'info', 'debug'], in order of increasing
@@ -227,12 +227,12 @@ def verbose(level='debug'):
227227
import logging
228228
229229
_log = logging.getLogger(__name__)
230-
_log.setLevel(logging.DEBUG) # or logging.WARNING, logging.INFO
230+
_log.setLevel(logging.INFO) # or logging.WARNING, logging.INFO
231231
232232
"""
233233

234234
if level is True:
235-
level = 'debug'
235+
level = 'info'
236236
if level is False:
237237
level = 'warning'
238238
_set_logger_verbose_level(level_str=level)

0 commit comments

Comments
 (0)
0