[SQL-CVS] r3920 - in SQLObject/trunk: docs sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2009-07-17 10:47:39
|
Author: phd Date: 2009-07-17 04:47:30 -0600 (Fri, 17 Jul 2009) New Revision: 3920 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/dbconnection.py Log: Minor change in logging to console - logger no longer stores the output file, it gets the file from module sys. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-07-16 04:16:46 UTC (rev 3919) +++ SQLObject/trunk/docs/News.txt 2009-07-17 10:47:30 UTC (rev 3920) @@ -45,6 +45,11 @@ indicate no password set. By default, it uses the md5 library for hashing, but this can be changed in a HashCol definition. +* Minor change in logging to console - logger no longer stores the output + file, it gets the file from module sys every time by name; this means + logging will use new sys.stdout (or stderr) in case the user changed + them. + * Changed the order of testing of SQLite modules - look for external PySQLite2 before sqlite3. Modified: SQLObject/trunk/sqlobject/dbconnection.py =================================================================== --- SQLObject/trunk/sqlobject/dbconnection.py 2009-07-16 04:16:46 UTC (rev 3919) +++ SQLObject/trunk/sqlobject/dbconnection.py 2009-07-17 10:47:30 UTC (rev 3920) @@ -29,10 +29,10 @@ class ConsoleWriter: def __init__(self, loglevel): - self.loglevel = loglevel - self.logfile = getattr(sys, loglevel or "stdout") + self.loglevel = loglevel # None or empty string for stdout; or 'stderr' def write(self, text): - self.logfile.write(text + '\n') + logfile = getattr(sys, self.loglevel or "stdout") + logfile.write(text + '\n') class LogWriter: def __init__(self, logger, loglevel): |