core: use of the new core.log module:

/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
This commit is contained in:
Goffi 2014-04-19 19:19:19 +02:00
commit 501bc92528

View file

@ -19,7 +19,8 @@
from sat.core.i18n import _
from sat.core.constants import Const as C
from logging import debug, info, error
from sat.core.log import getLogger
log = getLogger(__name__)
from wokkel.pubsub import PubSubRequest
from wokkel import disco, pubsub
from zope.interface import implements
@ -49,7 +50,7 @@ class XEP_0060(object):
OPT_PUBLISH_MODEL = 'pubsub#publish_model'
def __init__(self, host):
info(_("PubSub plugin initialization"))
log.info(_("PubSub plugin initialization"))
self.host = host
self.managedNodes = []
self.clients = {}
@ -86,13 +87,13 @@ class XEP_0060(object):
err_mess = _('Trying to %(action)s with an unknown profile key [%(profile_key)s]') % {
'action': action,
'profile_key': profile_key}
error(err_mess)
log.error(err_mess)
raise Exception(err_mess)
try:
client = self.clients[profile]
except KeyError:
err_mess = _('INTERNAL ERROR: no handler for required profile')
error(err_mess)
log.error(err_mess)
raise Exception(err_mess)
return profile, client
@ -215,7 +216,7 @@ class SatPubSubClient(pubsub.PubSubClient):
def deleteReceived(self, event):
#TODO: manage delete event
debug(_("Publish node deleted"))
log.debug(_("Publish node deleted"))
# def purgeReceived(self, event):