Add logging info when connect to database
This commit is contained in:
1 parent
3471a35d7e
commit
51a33d26f6
1 file changed
+2
@@ -40,6 +40,8 @@ class Database(DatabaseInterface):
|
||||
def connect(self):
|
||||
if self._connpool is not None:
|
||||
return self
|
||||
logger = logging.getLogger('database')
|
||||
logger.info('connect to "%s"' % self.database_name)
|
||||
host = CONFIG['db_host'] and "host=%s" % CONFIG['db_host'] or ''
|
||||
port = CONFIG['db_port'] and "port=%s" % CONFIG['db_port'] or ''
|
||||
name = "dbname=%s" % self.database_name
|
||||
|
||||
Reference in new issue
Block a user