Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.py @ 4421:67bef70ab9b9
- more logger fixes, sorry for the noise.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Fri, 17 Sep 2010 06:47:58 +0000 |
| parents | 9655a1b65974 |
| children | f2f2904fe6ce |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Thu Sep 16 07:44:50 2010 +0000 +++ b/roundup/backends/back_anydbm.py Fri Sep 17 06:47:58 2010 +0000 @@ -224,7 +224,7 @@ # 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 @@ 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 @@ """ 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 @@ 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 @@ """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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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:
