diff options
-rw-r--r-- | Lib/logging/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 08e6e47..987bc13 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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'. |