Add debug logging of lasso library
authorSimo Sorce <simo@redhat.com>
Fri, 11 Apr 2014 20:36:16 +0000 (16:36 -0400)
committerSimo Sorce <simo@redhat.com>
Fri, 11 Apr 2014 21:25:54 +0000 (17:25 -0400)
If debug is enabled make lasso spit debug messages to stderr too, to aid
admins in resolving issues related to saml2 issues, like finding out why
a metadata file may be rejected.

This is very simple for now, a future enhancement may involve piping the
logs into a calss so they can be spat out as feedback to users.

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/providers/saml2idp.py

index 0c8358d..1922c53 100755 (executable)
@@ -188,6 +188,13 @@ Provides SAML 2.0 authentication infrastructure. """
                 'example.com'
             ]
         }
+        if cherrypy.config.get('debug', False):
+            import logging
+            import sys
+            logger = logging.getLogger('lasso')
+            lh = logging.StreamHandler(sys.stderr)
+            logger.addHandler(lh)
+            logger.setLevel(logging.DEBUG)
 
     @property
     def allow_self_registration(self):