From b2635b2f7163716d735e7eda7c1d5c039410d3e4 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 24 Sep 2004 11:45:52 +0000 Subject: Added log() function --- Lib/logging/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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'. -- cgit v0.12