Changes for new logging scheme.

This commit is contained in:
Eratosthenes 2009-11-23 19:32:19 -05:00
parent 2da6e44a75
commit bdc3248597

View File

@ -45,7 +45,8 @@ import Card
import Tourney import Tourney
from Exceptions import * from Exceptions import *
log = Configuration.get_logger("logging.conf") log = Configuration.get_logger("logging.conf", config = "db")
log.debug("db logger initialized.")
class Database: class Database:
@ -186,14 +187,13 @@ class Database:
self.config = c self.config = c
self.fdb = fpdb_db.fpdb_db() # sets self.fdb.db self.fdb.cursor and self.fdb.sql self.fdb = fpdb_db.fpdb_db() # sets self.fdb.db self.fdb.cursor and self.fdb.sql
self.do_connect(c) self.do_connect(c)
print "connection =", self.connection
if self.backend == self.PGSQL: if self.backend == self.PGSQL:
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE
#ISOLATION_LEVEL_AUTOCOMMIT = 0 #ISOLATION_LEVEL_AUTOCOMMIT = 0
#ISOLATION_LEVEL_READ_COMMITTED = 1 #ISOLATION_LEVEL_READ_COMMITTED = 1
#ISOLATION_LEVEL_SERIALIZABLE = 2 #ISOLATION_LEVEL_SERIALIZABLE = 2
# where possible avoid creating new SQL instance by using the global one passed in # where possible avoid creating new SQL instance by using the global one passed in
if sql is None: if sql is None:
self.sql = SQL.Sql(db_server = self.db_server) self.sql = SQL.Sql(db_server = self.db_server)