Author: justi9
Date: 2009-07-16 14:32:50 -0400 (Thu, 16 Jul 2009)
New Revision: 3498
Modified:
mgmt/trunk/mint/python/mint/main.py
Log:
Log according to the configured level and file
Modified: mgmt/trunk/mint/python/mint/main.py
===================================================================
--- mgmt/trunk/mint/python/mint/main.py 2009-07-16 18:30:52 UTC (rev 3497)
+++ mgmt/trunk/mint/python/mint/main.py 2009-07-16 18:32:50 UTC (rev 3498)
@@ -1,6 +1,7 @@
import sys
import os
import logging
+
from parsley.config import Config, ConfigParameter
from parsley.loggingex import enable_logging
@@ -79,6 +80,9 @@
hdef = os.path.normpath("/var/lib/mint")
self.home = os.environ.get("MINT_HOME", hdef)
+ if not os.path.isdir(self.home):
+ raise Exception("Home path '%s' is not a directory")
+
param = ConfigParameter(self, "data", str)
param.default = "postgresql://mint@localhost/mint"
@@ -109,7 +113,7 @@
if opts:
self.load_dict(opts)
+ enable_logging("mint", self.log_level, self.log_file)
+
if self.debug:
enable_logging("mint", "debug", sys.stderr)
- else:
- enable_logging("mint", self.log_level, self.log_file)