Changed logging
authorThierry Florac <thierry.florac@onf.fr>
Mon, 02 Mar 2015 10:01:38 +0100
changeset 15 cb45428a26a1
parent 14 999c46679f3e
child 16 fc2ffccae559
Changed logging
src/pyams_security/plugin/group.py
--- a/src/pyams_security/plugin/group.py	Sat Feb 28 15:37:23 2015 +0100
+++ b/src/pyams_security/plugin/group.py	Mon Mar 02 10:01:38 2015 +0100
@@ -14,6 +14,8 @@
 
 
 # import standard library
+import logging
+logger = logging.getLogger('PyAMS(security)')
 
 # import interfaces
 from pyams_security.interfaces import IGroupsFolderPlugin, ILocalGroup, IPrincipalsAddedToGroupEvent, \
@@ -54,10 +56,12 @@
             self._principals = value
             registry = check_request().registry
             if added:
-                print(">> added =", added)
+                logger.debug("Added principals {0} to group {1} ({2})".format(str(added), self.group_id,
+                                                                              self.title))
                 registry.notify(PrincipalsAddedToGroupEvent(self, added))
             if removed:
-                print("<< removed =", removed)
+                logger.debug("Removed principals {0} from group {1} ({2})".format(str(removed), self.group_id,
+                                                                                  self.title))
                 registry.notify(PrincipalsRemovedFromGroupEvent(self, removed))