Added log() function
This commit is contained in:
parent
02dd994adf
commit
b2635b2f71
|
@ -1245,6 +1245,14 @@ def debug(msg, *args, **kwargs):
|
|||
basicConfig()
|
||||
apply(root.debug, (msg,)+args, kwargs)
|
||||
|
||||
def log(level, msg, *args, **kwargs):
|
||||
"""
|
||||
Log 'msg % args' with the integer severity 'level' on the root logger.
|
||||
"""
|
||||
if len(root.handlers) == 0:
|
||||
basicConfig()
|
||||
apply(root.log, (level, msg)+args, kwargs)
|
||||
|
||||
def disable(level):
|
||||
"""
|
||||
Disable all logging calls less severe than 'level'.
|
||||
|
|
Loading…
Reference in New Issue