summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b941a4)
raw | patch | inline | side by side (parent: 4b941a4)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 17 Sep 2010 06:47:58 +0000 (06:47 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 17 Sep 2010 06:47:58 +0000 (06:47 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4527 57a73879-2fb5-44c3-a270-3262357dd7e2
index 55c5456c8511ee57dabb8d4764b4c434e11998c8..463a43f56011f4fd43b2e5936d88f6bbfc0e5106 100644 (file)
# 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')
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)
""" 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):
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:
"""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]):
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()
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)))
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()
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
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:
index 5d30c3875285f5557c80796443e80f705db9f487..d43659e44bcb6a0c6927b3ab790b80399fa8f196 100644 (file)
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):
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:
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()
# 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
index c9ca63bc151a3d91dabd34d9acdb52879a0ddc80..2408c590fdc4e5c105e2e1a094cd19ccd405a11b 100644 (file)
# 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 = {}
index af1619656f91b7f9489236bf9584da753bd5cd59..912dd81134c06cf4b055d15b3f3ebcc03685464d 100644 (file)
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)
"""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):
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()
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()
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 7ebda75d7f4a9bb67581754c8290f578943c0068..072233803910484bda0d2973cc6ffb37129c5b70 100644 (file)
--- a/scripts/imapServer.py
+++ b/scripts/imapServer.py
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 381b21f48a4b43806b4e3051083159b82c9dc2d0..7354e67fff0d902caf09eb2819e8810646cee085 100644 (file)
--- a/test/db_test_base.py
+++ b/test/db_test_base.py
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):