From 5ebaab4ac1a68e72e3721ea4edb923b4638dcc35 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 19 Jul 2013 04:38:55 -0500 Subject: [PATCH] fixed issue 1591:Allow sql log customization --- VERSION | 2 +- gluon/dal.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 187dd920..d1fbe6cb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.07.19.04.34.00 +Version 2.6.0-development+timestamp.2013.07.19.04.38.04 diff --git a/gluon/dal.py b/gluon/dal.py index 44b94278..c164798c 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -710,6 +710,7 @@ class BaseAdapter(ConnectionPool): os.unlink(filename) def find_driver(self,adapter_args,uri=None): + self.adapter_args = adapter_args if getattr(self,'driver',None) != None: return drivers_available = [driver for driver in self.drivers @@ -950,7 +951,8 @@ class BaseAdapter(ConnectionPool): dbpath, '%s_%s.table' % (table._db._uri_hash, tablename)) if table._dbt: - table._loggername = pjoin(dbpath, 'sql.log') + logfilename = self._adepter.adapter_args.get('logfile','sql.log') + table._loggername = pjoin(dbpath, logfilename) logfile = self.file_open(table._loggername, 'a') else: logfile = None