X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAccessor.py;h=7352f471b889953495f0316070b10ef226281e23;hb=19d4a01ccf66af9e00914351b3eacd5fc880f988;hp=e8a69f570daf50896e2b9e32e48357698ab6e672;hpb=36de11f1c6e35ae81eb4774a395f3507cd44feb3;p=plcapi.git diff --git a/PLC/Accessor.py b/PLC/Accessor.py index e8a69f5..7352f47 100644 --- a/PLC/Accessor.py +++ b/PLC/Accessor.py @@ -9,7 +9,7 @@ # by the Factory, you need to restart your python instance / web server # as the cached information then becomes wrong -from PLC.Debug import log +from PLC.Logger import logger from PLC.TagTypes import TagTypes, TagType from PLC.Roles import Roles, Role @@ -57,9 +57,9 @@ This is implemented as a singleton, so we can cache results over time""" for rolename in roles_to_delete: tag_type.remove_role(self.hash_name_to_role[rolename]) except: - # this goes in boot.log ... - print >> log, "WARNING, Could not enforce tag type, tagname=%s\n"%tagname - traceback.print_exc(file=log) + logger.exception("WARNING, Could not enforce tag type, tagname={}\n" + .format(tagname)) + else: # not found: create it @@ -74,7 +74,9 @@ This is implemented as a singleton, so we can cache results over time""" tag_type.add_role(role_obj) except: # xxx todo find a more appropriate way of notifying this - print >> log, "Accessor.locate_or_create_tag: Could not add role %r to tag_type %s"%(role,tagname) + logger.exception("Accessor.locate_or_create_tag: " + "Could not add role {} to tag_type {}" + .format(role,tagname)) self.set_cache(tagname,tag_type) return tag_type