Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9466fe8

Browse files
committed
Logging documentatio update.
1 parent f86aa7c commit 9466fe8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/logging.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ following example::
167167
# command line argument. Convert to upper case to allow the user to
168168
# specify --log=DEBUG or --log=debug
169169
numeric_level = getattr(logging, loglevel.upper(), None)
170-
assert numeric_level is not None, 'Invalid log level: %s' % loglevel
170+
if not isinstance(numeric_level, int):
171+
raise ValueError('Invalid log level: %s' % loglevel)
171172
logging.basicConfig(level=numeric_level, ...)
172173

173174
The call to :func:`basicConfig` should come *before* any calls to :func:`debug`,

0 commit comments

Comments
 (0)