[csw-devel] SF.net SVN: gar:[12974] csw/mgar/gar/v2/lib/python/pkgdb.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Jan 17 10:28:05 CET 2011


Revision: 12974
          http://gar.svn.sourceforge.net/gar/?rev=12974&view=rev
Author:   wahwah
Date:     2011-01-17 09:28:05 +0000 (Mon, 17 Jan 2011)

Log Message:
-----------
pkgdb: Logging bugfix

Moving SetUpSqlobjectConnection after the logging module initialization.
Otherwise, the logging module would get initialized with the default
values and default logging level, hard-pinning the logging level to
warning.  This fix makes the --debug option take effect again.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/pkgdb.py

Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py	2011-01-17 09:27:45 UTC (rev 12973)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2011-01-17 09:28:05 UTC (rev 12974)
@@ -322,7 +322,6 @@
 
 
 def main():
-  configuration.SetUpSqlobjectConnection()
 
   parser = optparse.OptionParser(USAGE)
   parser.add_option("-d", "--debug", dest="debug",
@@ -348,10 +347,14 @@
   options, args = parser.parse_args()
   if options.debug:
     logging.basicConfig(level=logging.DEBUG)
+    logging.debug("Debugging on")
   else:
     logging.basicConfig(level=logging.INFO)
   if not args:
     raise UsageError("Please specify a command.  Se --help.")
+  # SetUpSqlobjectConnection needs to be called after
+  # logging.basicConfig
+  configuration.SetUpSqlobjectConnection()
   command = args[0]
   args = args[1:]
   if command == 'show':


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list