summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-03-13 13:53:31 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-03-13 13:53:31 -0500
commit5f1fbf575915470391c5a816d99a742e64b6be25 (patch)
treee47cc04988a835ef03f1b3bb02e5a5c4d0495e24 /lib/sqlalchemy/engine/base.py
parent3290ac23df9eed8a61324eb68f062a7de29e549d (diff)
downloadsqlalchemy-5f1fbf575915470391c5a816d99a742e64b6be25.tar.gz
- Added "logging_name" argument to create_engine(), Pool() constructor
as well as "pool_logging_name" argument to create_engine() which filters down to that of Pool. Issues the given string name within the "name" field of logging messages instead of the default hex identifier string. [ticket:1555]
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r--lib/sqlalchemy/engine/base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index ea6282954..fa0059130 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -1387,17 +1387,19 @@ class TwoPhaseTransaction(Transaction):
self.connection._commit_twophase_impl(self.xid, self._is_prepared)
-class Engine(Connectable):
+class Engine(Connectable, log.Identified):
"""
Connects a :class:`~sqlalchemy.pool.Pool` and :class:`~sqlalchemy.engine.base.Dialect`
together to provide a source of database connectivity and behavior.
"""
- def __init__(self, pool, dialect, url, echo=None, proxy=None):
+ def __init__(self, pool, dialect, url, logging_name=None, echo=None, proxy=None):
self.pool = pool
self.url = url
self.dialect = dialect
+ if logging_name:
+ self.logging_name = logging_name
self.echo = echo
self.engine = self
self.logger = log.instance_logger(self, echoflag=echo)