Author: justi9
Date: 2008-05-21 11:55:53 -0400 (Wed, 21 May 2008)
New Revision: 2076
Modified:
mgmt/cumin/bin/cumin
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/model.py
mgmt/mint/python/mint/__init__.py
Log:
Prevent traces from printing to the console
Modified: mgmt/cumin/bin/cumin
===================================================================
--- mgmt/cumin/bin/cumin 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/bin/cumin 2008-05-21 15:55:53 UTC (rev 2076)
@@ -1,13 +1,16 @@
#!/usr/bin/python
-import sys, os, socket, logging
+import sys, os, socket
+from logging import getLogger
+
from cumin import *
from cumin.util import *
+log = getLogger("cumin")
+
def do_main(config):
app = Cumin(config.home, config.data, config.spec)
- log = logging.getLogger("cumin.config")
if config.debug:
app.enable_debug()
@@ -15,9 +18,7 @@
try:
app.check()
except Exception, e:
- if hasattr(e, "message"):
- print e.message
-
+ log.exception(e)
sys.exit(1)
app.init()
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/python/cumin/__init__.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -9,7 +9,6 @@
from mint import *
from time import sleep
from threading import Thread, Event
-from traceback import print_exc
from base64 import decodestring
from crypt import crypt
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/python/cumin/model.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -4,12 +4,14 @@
from time import mktime
from datetime import datetime, timedelta
from types import *
-from traceback import print_exc
+from logging import getLogger
from util import *
from formats import *
from parameters import *
+log = getLogger("cumin.model")
+
class CuminModel(object):
def __init__(self, app, data_uri, spec_path):
self.app = app
@@ -145,7 +147,7 @@
invoc.status = "failed"
invoc.exception = e
- print_exc();
+ log.exception(e)
finally:
self.cumin_model.invocations.add(invoc)
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/mint/python/mint/__init__.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -60,7 +60,6 @@
log.info("Connection succeeded")
except:
log.info("Connection failed: " + str(conn.exception))
- print_exc()
def getDefaultVhost(self):
if self.broker: