engine.echo = False doesn't work
Issue #1554
resolved
Setting {{{engine.echo = False}}} does not suppress SQL logging if the parent logger (sqlalchemy.engine) is INFO or DEBUG. This makes it impossible to shut up an oververbose engine while logging other engines. The problem is that the log level is set to NOTSET rather than WARN, so it inherits the level of its parent logger. But that's counterintuitive because if somebody sets echo=False, they intend to suppress logging. echo=None would be a value suitable to restore the default behavior.
This also gets into the logger name, which I'll address in another ticket.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
echo was never meant to be used if the application is making explicit use of logging. There's many reasons they can't really work together, not the least of which is that "echo" does a logging.basicConfig() and sets up a handler unconditionally.
but a setting of False can set WARN and None would to NOTSET, I don't think that would get in anyone's way...but we can also target it for 0.6 so that there's a hard boundary of the new behavior. Hope that's OK.