Code

- more logger fixes -- use correct hierarchical logger names always
authorschlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 16 Sep 2010 07:44:50 +0000 (07:44 +0000)
committerschlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 16 Sep 2010 07:44:50 +0000 (07:44 +0000)
  starting with "roundup." -- otherwise logger configuration changed in
  changeset r4517 will not work (e.g. turning debugging on)

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4526 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/backends/back_anydbm.py
roundup/backends/back_postgresql.py
roundup/backends/back_sqlite.py
roundup/backends/rdbms_common.py
roundup/mailgw.py
roundup/roundupdb.py

index 0bbba4c4dafacb6c032c5b698a1cdc7804cc7442..55c5456c8511ee57dabb8d4764b4c434e11998c8 100644 (file)
@@ -176,7 +176,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database):
     def clear(self):
         """Delete all database contents
         """
-        logging.getLogger('hyperdb').info('clear')
+        logging.getLogger('roundup.hyperdb').info('clear')
         for cn in self.classes:
             for dummy in 'nodes', 'journals':
                 path = os.path.join(self.dir, 'journals.%s'%cn)
index e066083eaecc2bb2db9f819c0b3ea75a92373f76..5d30c3875285f5557c80796443e80f705db9f487 100644 (file)
@@ -36,7 +36,7 @@ def connection_dict(config, dbnamestr=None):
 def db_create(config):
     """Clear all database contents and drop database itself"""
     command = "CREATE DATABASE %s WITH ENCODING='UNICODE'"%config.RDBMS_NAME
-    logging.getLogger('hyperdb').info(command)
+    logging.getLogger('roundup.hyperdb').info(command)
     db_command(config, command)
 
 def db_nuke(config, fail_ok=0):
index 5d6be0195750cd67e05acf7ed1680c2732f8869c..c9ca63bc151a3d91dabd34d9acdb52879a0ddc80 100644 (file)
@@ -99,7 +99,7 @@ class Database(rdbms_common.Database):
             os.makedirs(self.config.DATABASE)
 
         db = os.path.join(self.config.DATABASE, 'db')
-        logging.getLogger('hyperdb').info('open database %r'%db)
+        logging.getLogger('roundup.hyperdb').info('open database %r'%db)
         # set timeout (30 second default is extraordinarily generous)
         # for handling locked database
         if sqlite_version == 1:
index 2520aba25d4c39015b50d92b93700dc444671920..af1619656f91b7f9489236bf9584da753bd5cd59 100644 (file)
@@ -445,7 +445,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database):
             # no changes
             return 0
 
-        logger = logging.getLogger('hyperdb')
+        logger = logging.getLogger('roundup.hyperdb')
         logger.info('update_class %s'%spec.classname)
 
         logger.debug('old_spec %r'%(old_spec,))
index 38b3e370e217d66706a6416973b65269649fbc2c..d96d5edaaba08cc65563173a4e7a82db2feff63b 100644 (file)
@@ -520,7 +520,7 @@ class MailGW:
                 self.default_class = value.strip()
 
         self.mailer = Mailer(instance.config)
-        self.logger = logging.getLogger('mailgw')
+        self.logger = logging.getLogger('roundup.mailgw')
 
         # should we trap exceptions (normal usage) or pass them through
         # (for testing)
index 45fb8e8b583c94829aa4cb30f60279194fff76bc..7d40da471f46277215e13edf4841c3970bc55d53 100644 (file)
@@ -137,7 +137,7 @@ class Database:
         # Because getting a logger requires acquiring a lock, we want
         # to do it only once.
         if not hasattr(self, '__logger'):
-            self.__logger = logging.getLogger('hyperdb')
+            self.__logger = logging.getLogger('roundup.hyperdb')
 
         return self.__logger