move above logfile initialization code
authorJF Ding <jfding@gmail.com>
Thu, 20 Oct 2011 07:10:21 +0000 (15:10 +0800)
committerJF Ding <jfding@gmail.com>
Thu, 20 Oct 2011 07:10:21 +0000 (15:10 +0800)
mic/creator.py

index bc7dd0804fc2b511e40d7578d1af02d3e1a69741..1e1affbe56f550a1adb7c179363faf0d736c3907 100644 (file)
@@ -112,6 +112,10 @@ class Creator(cmdln.Cmdln):
         if self.options.debug:
             msger.set_loglevel('debug')
 
+        if self.options.logfile:
+            msger.set_interactive(False)
+            msger.set_logfile(self.options.logfile)
+
         if self.options.config:
             self.configmgr.reset()
             self.configmgr._siteconf = self.options.config
@@ -140,10 +144,6 @@ class Creator(cmdln.Cmdln):
         if self.options.pkgmgr is not None:
             self.configmgr.create['pkgmgr'] = self.options.pkgmgr
 
-        if self.options.logfile:
-            msger.set_interactive(False)
-            msger.set_logfile(self.options.logfile)
-
     def main(self, argv=None):
         if argv is None:
             argv = sys.argv