From f56d043854cb4281c81e2ee6a6b99ff9d03ad9d6 Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Wed, 24 Apr 2013 16:47:07 -0300 Subject: Improve the rest and start everything from start_mx --- src/leap/mx/couchdbhelper.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/leap/mx/couchdbhelper.py') diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py index 4e76be3..2bbca77 100644 --- a/src/leap/mx/couchdbhelper.py +++ b/src/leap/mx/couchdbhelper.py @@ -20,6 +20,10 @@ Classes for working with CouchDB or BigCouch instances which store email alias maps, user UUIDs, and GPG keyIDs. """ +import logging + +from functools import partial + try: from paisley import client except ImportError: @@ -32,9 +36,7 @@ except ImportError: print "This software requires Twisted. Please see the README file" print "for instructions on getting required dependencies." -from functools import partial - -from leap.mx.util import log +logger = logging.getLogger(__name__) class ConnectedCouchDB(client.CouchDB): @@ -82,9 +84,9 @@ class ConnectedCouchDB(client.CouchDB): @param data: response from the listDB command @type data: array """ - log.msg("Available databases:") + logger.msg("Available databases:") for database in data: - log.msg(" * %s" % (database,)) + logger.msg(" * %s" % (database,)) def createDB(self, dbName): """ @@ -117,7 +119,7 @@ class ConnectedCouchDB(client.CouchDB): reduce=False, include_docs=True) - d.addCallbacks(partial(self._get_uuid, alias), log.err) + d.addCallbacks(partial(self._get_uuid, alias), logger.error) return d -- cgit v1.2.3