mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Added log() function
This commit is contained in:
parent
02dd994adf
commit
b2635b2f71
1 changed files with 8 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue