changeset 3165:b8dc6c2e6c53

integrate MoinMoin.support.logging_fix into MoinMoin.log
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 02 Mar 2008 02:19:42 +0100
parents c25bc6e9ad61
children a56218a337fb
files MoinMoin/log.py MoinMoin/support/logging_fix.py
diffstat 2 files changed, 14 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/log.py	Sun Mar 02 02:10:28 2008 +0100
+++ b/MoinMoin/log.py	Sun Mar 02 02:19:42 2008 +0100
@@ -22,7 +22,8 @@
     If you don't configure it, some upperlevel logger (e.g. the root logger)
     will do the logging.
 
-    @copyright: 2008 MoinMoin:ThomasWaldmann
+    @copyright: 2008 MoinMoin:ThomasWaldmann,
+                2007 MoinMoin:JohannesBerg 
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -68,7 +69,6 @@
 class=logging.Formatter
 """
 
-from MoinMoin.support import logging_fix
 import logging, logging.config
 
 configured = False
@@ -114,3 +114,15 @@
             setattr(logger, levelname, levelnumber)
     return logger
 
+
+# Python 2.3's logging module has no .log, this provides it:
+if not hasattr(logging, 'log'):
+    def log(level, msg, *args, **kwargs):
+        if len(logging.root.handlers) == 0:
+            logging.basicConfig()
+        if logging.root.manager.disable >= level:
+            return
+        if level >= logging.root.getEffectiveLevel():
+            logging.root._log(level, msg, args, **kwargs)
+    logging.log = log
+
--- a/MoinMoin/support/logging_fix.py	Sun Mar 02 02:10:28 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-"""
-    Python 2.3's logging module has no .log, this provides it.
-
-    @copyright: 2007 MoinMoin:JohannesBerg 
-    @license: GNU GPL, see COPYING for details.
-"""
-
-import logging
-if not hasattr(logging, 'log'):
-    def log(level, msg, *args, **kwargs):
-        if len(logging.root.handlers) == 0:
-            logging.basicConfig()
-        if logging.root.manager.disable >= level:
-            return
-        if level >= logging.root.getEffectiveLevel():
-            logging.root._log(level, msg, args, **kwargs)
-    logging.log = log