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

@ -21,7 +21,8 @@
from sat.core.i18n import _
import sys
from logging import debug, warning
from sat.core.log import getLogger
log = getLogger(__name__)
class TriggerException(Exception):
@ -55,9 +56,9 @@ class TriggerManager(object):
self.__triggers[point_name] = []
if priority != 0 and priority in [trigger_tuple[0] for trigger_tuple in self.__triggers[point_name]]:
if priority in (self.MIN_PRIORITY, self.MAX_PRIORITY):
warning(_("There is already a bound priority [%s]") % point_name)
log.warning(_("There is already a bound priority [%s]") % point_name)
else:
debug(_("There is already a trigger with the same priority [%s]") % point_name)
log.debug(_("There is already a trigger with the same priority [%s]") % point_name)
self.__triggers[point_name].append((priority, callback))
self.__triggers[point_name].sort(key=lambda trigger_tuple:
trigger_tuple[0], reverse=True)