Author: justi9
Date: 2008-04-23 15:22:47 -0400 (Wed, 23 Apr 2008)
New Revision: 1967
Modified:
mgmt/cumin/python/cumin/__init__.py
mgmt/mint/python/mint/__init__.py
mgmt/notes/justin-todo.txt
Log:
Fix logging configuration
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-04-23 14:09:44 UTC (rev 1966)
+++ mgmt/cumin/python/cumin/__init__.py 2008-04-23 19:22:47 UTC (rev 1967)
@@ -20,6 +20,8 @@
from action import ActionPage
from util import Config
+log = logging.getLogger("cumin")
+
class Cumin(Application):
def __init__(self, home, data_uri, spec_path):
super(Cumin, self).__init__()
@@ -82,11 +84,10 @@
for reg in BrokerRegistration.select():
if reg.broker is None or reg.broker.managedBroker not in \
self.model.data.connections:
-
attempts = self.attempts.get(reg, 0)
attempts += 1
self.attempts[reg] = attempts
-
+
if attempts < 10:
reg.connect(self.model.data)
elif attempts < 100 and attempts % 10 == 0:
@@ -158,33 +159,28 @@
self.add_param("debug", bool, False, summ)
def init(self):
- root = logging.getLogger("cumin")
- root.setLevel(logging.NOTSET)
+ root = logging.getLogger()
self.load_defaults()
self.load_args(sys.argv)
- h = self.get_console_handler()
+ h = logging.StreamHandler()
root.addHandler(h)
self.load_file(os.path.join(self.home, "etc", "cumin.conf"))
self.load_file(os.path.join(os.path.expanduser("~"),
".cumin.conf"))
self.load_args(sys.argv)
root.removeHandler(h)
- h = self.get_console_handler()
+ h = logging.StreamHandler()
+ h.setLevel(self.debug and logging.DEBUG or logging.ERROR)
root.addHandler(h)
h = logging.FileHandler(self.log)
- if self.debug:
- h.setLevel(logging.DEBUG)
- else:
- h.setLevel(logging.INFO)
+ h.setLevel(self.debug and logging.DEBUG or logging.INFO)
root.addHandler(h)
+ log.setLevel(self.debug and logging.DEBUG or logging.INFO)
+
def get_console_handler(self):
h = logging.StreamHandler()
- if self.debug:
- h.setLevel(logging.DEBUG)
- else:
- h.setLevel(logging.ERROR)
return h
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-04-23 14:09:44 UTC (rev 1966)
+++ mgmt/mint/python/mint/__init__.py 2008-04-23 19:22:47 UTC (rev 1967)
@@ -260,6 +260,9 @@
assert MintModel.staticInstance is None
MintModel.staticInstance = self
+ if self.debug:
+ log.setLevel(logging.DEBUG)
+
def check(self):
try:
connectionForURI(self.dataUri)
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2008-04-23 14:09:44 UTC (rev 1966)
+++ mgmt/notes/justin-todo.txt 2008-04-23 19:22:47 UTC (rev 1967)
@@ -32,6 +32,10 @@
* Handle parameter exceptions
+ * Talk about AMQP_SPEC in the readme
+
+ * Fix double login bug
+
Deferred
* Change the way CuminAction.invoke works
Show replies by date