python/dist/src/Lib/logging __init__.py, 1.20, 1.21
Update of /cvsroot/python/python/dist/src/Lib/logging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12619 Modified Files: __init__.py Log Message: Added log() function Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/logging/__init__.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- __init__.py 22 Sep 2004 12:39:26 -0000 1.20 +++ __init__.py 24 Sep 2004 11:45:52 -0000 1.21 @@ -1245,6 +1245,14 @@ 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'.
participants (1)
-
vsajip@users.sourceforge.net