prevent traceback when parsing the log level
This commit is contained in:
parent
47d30eb973
commit
4f0300cd65
|
@ -27,7 +27,7 @@ def parseLogLevel(arg):
|
||||||
"""
|
"""
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
return int(arg)
|
return int(arg)
|
||||||
elif arg.isupper():
|
elif arg.isupper() and hasattr(logging, arg):
|
||||||
return getattr(logging, arg)
|
return getattr(logging, arg)
|
||||||
else:
|
else:
|
||||||
print _('%s is not a valid loglevel') % repr(arg)
|
print _('%s is not a valid loglevel') % repr(arg)
|
||||||
|
|
Loading…
Reference in New Issue