Author: justi9
Date: 2008-04-24 11:38:31 -0400 (Thu, 24 Apr 2008)
New Revision: 1974
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
Keep going if we can't write to our log file
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-04-24 15:30:09 UTC (rev 1973)
+++ mgmt/cumin/python/cumin/__init__.py 2008-04-24 15:38:31 UTC (rev 1974)
@@ -175,7 +175,11 @@
h.setLevel(self.debug and logging.DEBUG or logging.ERROR)
root.addHandler(h)
- h = logging.FileHandler(self.log)
+ try:
+ h = logging.FileHandler(self.log)
+ except IOError, e:
+ root.warn("Can't write to log file '%s': %s" %
(self.log, e))
+
h.setLevel(self.debug and logging.DEBUG or logging.INFO)
root.addHandler(h)