Added debug logs
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Jun 2018 15:49:48 +0200
changeset 21 3c93821dffeb
parent 20 918e27541429
child 22 f516090b2d51
Added debug logs
src/pyams_viewlet/viewlet.py
--- a/src/pyams_viewlet/viewlet.py	Mon Jun 11 15:44:10 2018 +0200
+++ b/src/pyams_viewlet/viewlet.py	Mon Jun 11 15:49:48 2018 +0200
@@ -14,6 +14,9 @@
 
 
 # import standard packages
+import logging
+logger = logging.getLogger('PyAMS (viewlet)')
+
 import venusian
 
 # import interfaces
@@ -102,6 +105,8 @@
                 bases = bases + (ViewContentProvider,)
             new_class = type('<ViewContentProvider %s>' % settings.get('name'), bases, cdict)
 
+            logger.debug("Registering content provider {0} ({1})".format(settings.get('name'),
+                                                                         str(new_class)))
             config = context.config.with_package(info.module)
             config.registry.registerAdapter(new_class,
                                             (settings.get('context', Interface),
@@ -188,6 +193,8 @@
                 bases = bases + (Viewlet,)
             new_class = type('<Viewlet %s>' % settings.get('name'), bases, cdict)
 
+            logger.debug("Registering viewlet {0} ({1})".format(settings.get('name'),
+                                                                str(new_class)))
             config = context.config.with_package(info.module)
             config.registry.registerAdapter(new_class,
                                             (settings.get('context', Interface),