I must be missing something simple, but with SQLA 0.4.6 I can't get
the logging to work without using the echo flag.  When I do set echo =
True and leave my logging configuration code I get the double logging
problem mentioned in the docs.

My apologies if this is just a logging module issue.  The primary bit
of documentation I'm using is this:
http://www.sqlalchemy.org/docs/04/dbengine.html#dbengine_logging

but I've also been digging around the logging.py docs and code without
any luck.

Below is a standalone script I've reduced to that demonstrates the
problem.  What do I need to do to make this output the SQL statements
to stdout?

####
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
import logging

_ORM_BASE = declarative_base()

class ORM_User(_ORM_BASE):
    __tablename__ = "user"
    id = sa.Column("id", sa.Integer, primary_key = True)
    login = sa.Column("login", sa.String(80), index = True, unique =
True)
    password = sa.Column("password", sa.String(80), nullable = False)

DbEngine = sa.create_engine('sqlite:///:memory:', echo = False)

logging.basicConfig(format = '%(message)s')
engineLogger = logging.getLogger('sqlalchemy.engine')
assert isinstance(engineLogger, logging.Logger)
assert engineLogger is not logging.root
engineLogger.setLevel(logging.DEBUG) # to get statements and results

_ORM_BASE.metadata.create_all(DbEngine)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to