[Sqlalchemy-tickets] [sqlalchemy] #2837: Logging FAQ suggestion
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-10-11 22:33:52
|
#2837: Logging FAQ suggestion
---------------------------+-----------------------------------------
Reporter: jonathan | Owner: zzzeek
Type: enhancement | Status: new
Priority: lowest | Milestone:
Component: documentation | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
---------------------------+-----------------------------------------
The FAQ on logging
http://docs.sqlalchemy.org/en/rel_0_8/faq.html?highlight=logging#how-
do-i-configure-logging
sent me to the Engine logging docs:
http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#dbengine-
logging
I wanted to suggest this addition to the docs :
-------
Sometimes you might want to disable existing query logging for certain
statements, such as when you are inserting a BLOB or large TEXT value.
An easy way to accomplish this is to wrap your query in a pair of
statements
that toggle the `disabled` attribute of the logger.
In the example below, note that the logger needed to disable already-
enabled
query logging is `sqlalchemy.engine.base.Engine` , and not the
`sqlalchemy.engine` logger mentioned above.
import logging
logging.getLogger('sqlalchemy.engine.base.Engine').disabled = True
... execute query ...
logging.getLogger('sqlalchemy.engine.base.Engine').disabled = False
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2837>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|