diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-12-13 08:54:02 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-12-13 08:54:02 (GMT) |
commit | 9466fe88a7cf586052a35537f50859fef8284d25 (patch) | |
tree | 208b1eef0378d6bbbd4b1ea6611711da17cd0ed2 /Doc/library/logging.rst | |
parent | f86aa7c3d22ace890e295c9bdf58ebfae90b13f1 (diff) | |
download | cpython-9466fe88a7cf586052a35537f50859fef8284d25.zip cpython-9466fe88a7cf586052a35537f50859fef8284d25.tar.gz cpython-9466fe88a7cf586052a35537f50859fef8284d25.tar.bz2 |
Logging documentatio update.
Diffstat (limited to 'Doc/library/logging.rst')
-rw-r--r-- | Doc/library/logging.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 490f69f..b59315e 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -167,7 +167,8 @@ following example:: # command line argument. Convert to upper case to allow the user to # specify --log=DEBUG or --log=debug 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, ...) The call to :func:`basicConfig` should come *before* any calls to :func:`debug`, |