From: schlatterbeck Date: Fri, 17 Sep 2010 06:47:58 +0000 (+0000) Subject: - more logger fixes, sorry for the noise. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a617ae06f46757b371b26918b789d29fbe7bf07c;p=roundup.git - more logger fixes, sorry for the noise. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4527 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 55c5456..463a43f 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -224,7 +224,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): # whichdb() function to do this if not db_type or hasattr(anydbm, 'whichdb'): if __debug__: - logging.getLogger('hyperdb').debug( + logging.getLogger('roundup.hyperdb').debug( "opendb anydbm.open(%r, 'c')"%path) return anydbm.open(path, 'c') @@ -236,7 +236,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): raise hyperdb.DatabaseError(_("Couldn't open database - the " "required module '%s' is not available")%db_type) if __debug__: - logging.getLogger('hyperdb').debug( + logging.getLogger('roundup.hyperdb').debug( "opendb %r.open(%r, %r)"%(db_type, path, mode)) return dbm.open(path, mode) @@ -297,7 +297,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): """ perform the saving of data specified by the set/addnode """ if __debug__: - logging.getLogger('hyperdb').debug('save %s%s %r'%(classname, nodeid, node)) + logging.getLogger('roundup.hyperdb').debug( + 'save %s%s %r'%(classname, nodeid, node)) self.transactions.append((self.doSaveNode, (classname, nodeid, node))) def getnode(self, classname, nodeid, db=None, cache=1): @@ -310,14 +311,16 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): cache_dict = self.cache.setdefault(classname, {}) if nodeid in cache_dict: if __debug__: - logging.getLogger('hyperdb').debug('get %s%s cached'%(classname, nodeid)) + logging.getLogger('roundup.hyperdb').debug( + 'get %s%s cached'%(classname, nodeid)) self.stats['cache_hits'] += 1 return cache_dict[nodeid] if __debug__: self.stats['cache_misses'] += 1 start_t = time.time() - logging.getLogger('hyperdb').debug('get %s%s'%(classname, nodeid)) + logging.getLogger('roundup.hyperdb').debug( + 'get %s%s'%(classname, nodeid)) # get from the database and save in the cache if db is None: @@ -349,7 +352,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): """Remove a node from the database. Called exclusively by the destroy() method on Class. """ - logging.getLogger('hyperdb').info('destroy %s%s'%(classname, nodeid)) + logging.getLogger('roundup.hyperdb').info( + 'destroy %s%s'%(classname, nodeid)) # remove from cache and newnodes if it's there if (classname in self.cache and nodeid in self.cache[classname]): @@ -472,7 +476,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): the current user. """ if __debug__: - logging.getLogger('hyperdb').debug('addjournal %s%s %s %r %s %r'%(classname, + logging.getLogger('roundup.hyperdb').debug( + 'addjournal %s%s %s %r %s %r'%(classname, nodeid, action, params, creator, creation)) if creator is None: creator = self.getuid() @@ -482,8 +487,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): def setjournal(self, classname, nodeid, journal): """Set the journal to the "journal" list.""" if __debug__: - logging.getLogger('hyperdb').debug('setjournal %s%s %r'%(classname, - nodeid, journal)) + logging.getLogger('roundup.hyperdb').debug( + 'setjournal %s%s %r'%(classname, nodeid, journal)) self.transactions.append((self.doSetJournal, (classname, nodeid, journal))) @@ -569,8 +574,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): packed += 1 db[key] = marshal.dumps(l) - logging.getLogger('hyperdb').info('packed %d %s items'%(packed, - classname)) + logging.getLogger('roundup.hyperdb').info( + 'packed %d %s items'%(packed, classname)) if db_type == 'gdbm': db.reorganize() @@ -592,7 +597,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): The only backend this seems to affect is postgres. """ - logging.getLogger('hyperdb').info('commit %s transactions'%( + logging.getLogger('roundup.hyperdb').info('commit %s transactions'%( len(self.transactions))) # keep a handle to all the database files opened @@ -715,7 +720,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): def rollback(self): """ Reverse all actions from the current transaction. """ - logging.getLogger('hyperdb').info('rollback %s transactions'%( + logging.getLogger('roundup.hyperdb').info('rollback %s transactions'%( len(self.transactions))) for method, args in self.transactions: diff --git a/roundup/backends/back_postgresql.py b/roundup/backends/back_postgresql.py index 5d30c38..d43659e 100644 --- a/roundup/backends/back_postgresql.py +++ b/roundup/backends/back_postgresql.py @@ -42,7 +42,7 @@ def db_create(config): def db_nuke(config, fail_ok=0): """Clear all database contents and drop database itself""" command = 'DROP DATABASE %s'% config.RDBMS_NAME - logging.getLogger('hyperdb').info(command) + logging.getLogger('roundup.hyperdb').info(command) db_command(config, command) if os.path.exists(config.DATABASE): @@ -131,7 +131,8 @@ class Database(rdbms_common.Database): def sql_open_connection(self): db = connection_dict(self.config, 'database') - logging.getLogger('hyperdb').info('open database %r'%db['database']) + logging.getLogger('roundup.hyperdb').info( + 'open database %r'%db['database']) try: conn = psycopg.connect(**db) except psycopg.OperationalError, message: @@ -218,7 +219,7 @@ class Database(rdbms_common.Database): def sql_commit(self, fail_ok=False): ''' Actually commit to the database. ''' - logging.getLogger('hyperdb').info('commit') + logging.getLogger('roundup.hyperdb').info('commit') try: self.conn.commit() @@ -226,7 +227,8 @@ class Database(rdbms_common.Database): # we've been instructed that this commit is allowed to fail if fail_ok and str(message).endswith('could not serialize ' 'access due to concurrent update'): - logging.getLogger('hyperdb').info('commit FAILED, but fail_ok') + logging.getLogger('roundup.hyperdb').info( + 'commit FAILED, but fail_ok') else: raise diff --git a/roundup/backends/back_sqlite.py b/roundup/backends/back_sqlite.py index c9ca63b..2408c59 100644 --- a/roundup/backends/back_sqlite.py +++ b/roundup/backends/back_sqlite.py @@ -186,7 +186,8 @@ class Database(rdbms_common.Database): # no changes return 0 - logging.getLogger('hyperdb').info('update_class %s'%spec.classname) + logging.getLogger('roundup.hyperdb').info( + 'update_class %s'%spec.classname) # detect multilinks that have been removed, and drop their table old_has = {} diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index af16196..912dd81 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -755,7 +755,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): Note: I don't commit here, which is different behaviour to the "nuke from orbit" behaviour in the dbs. """ - logging.getLogger('hyperdb').info('clear') + logging.getLogger('roundup.hyperdb').info('clear') for cn in self.classes: sql = 'delete from _%s'%cn self.sql(sql) @@ -1063,7 +1063,8 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): """Remove a node from the database. Called exclusively by the destroy() method on Class. """ - logging.getLogger('hyperdb').info('destroynode %s%s'%(classname, nodeid)) + logging.getLogger('roundup.hyperdb').info('destroynode %s%s'%( + classname, nodeid)) # make sure the node exists if not self.hasnode(classname, nodeid): @@ -1268,7 +1269,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): def sql_commit(self, fail_ok=False): """ Actually commit to the database. """ - logging.getLogger('hyperdb').info('commit') + logging.getLogger('roundup.hyperdb').info('commit') self.conn.commit() @@ -1309,7 +1310,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): Undo all the changes made since the database was opened or the last commit() or rollback() was performed. """ - logging.getLogger('hyperdb').info('rollback') + logging.getLogger('roundup.hyperdb').info('rollback') self.sql_rollback() @@ -1324,7 +1325,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): self.clearCache() def sql_close(self): - logging.getLogger('hyperdb').info('close') + logging.getLogger('roundup.hyperdb').info('close') self.conn.close() def close(self): diff --git a/scripts/imapServer.py b/scripts/imapServer.py index 7ebda75..0722338 100644 --- a/scripts/imapServer.py +++ b/scripts/imapServer.py @@ -39,7 +39,7 @@ import re import time logging.basicConfig() -log = logging.getLogger('IMAPServer') +log = logging.getLogger('roundup.IMAPServer') version = '0.1.2' diff --git a/test/db_test_base.py b/test/db_test_base.py index 381b21f..7354e67 100644 --- a/test/db_test_base.py +++ b/test/db_test_base.py @@ -128,7 +128,7 @@ if os.environ.has_key('LOGGING_LEVEL'): from roundup import rlog config.logging = rlog.BasicLogging() config.logging.setLevel(os.environ['LOGGING_LEVEL']) - config.logging.getLogger('hyperdb').setFormat('%(message)s') + config.logging.getLogger('roundup.hyperdb').setFormat('%(message)s') class DBTest(MyTestCase): def setUp(self):