mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Logging documentatio update.
This commit is contained in:
parent
f86aa7c3d2
commit
9466fe88a7
1 changed files with 2 additions and 1 deletions
|
|
@ -167,7 +167,8 @@ following example::
|
||||||
# command line argument. Convert to upper case to allow the user to
|
# command line argument. Convert to upper case to allow the user to
|
||||||
# specify --log=DEBUG or --log=debug
|
# specify --log=DEBUG or --log=debug
|
||||||
numeric_level = getattr(logging, loglevel.upper(), None)
|
numeric_level = getattr(logging, loglevel.upper(), None)
|
||||||
assert numeric_level is not None, 'Invalid log level: %s' % loglevel
|
if not isinstance(numeric_level, int):
|
||||||
|
raise ValueError('Invalid log level: %s' % loglevel)
|
||||||
logging.basicConfig(level=numeric_level, ...)
|
logging.basicConfig(level=numeric_level, ...)
|
||||||
|
|
||||||
The call to :func:`basicConfig` should come *before* any calls to :func:`debug`,
|
The call to :func:`basicConfig` should come *before* any calls to :func:`debug`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue