From: Vinay Sajip Date: Fri, 24 Sep 2004 11:45:52 +0000 (+0000) Subject: Added log() function X-Git-Tag: v2.4b1~202 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2635b2f7163716d735e7eda7c1d5c039410d3e4;p=thirdparty%2FPython%2Fcpython.git Added log() function --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 08e6e471e374..987bc13722d3 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'.