From: Simo Sorce Date: Fri, 11 Apr 2014 20:36:16 +0000 (-0400) Subject: Add debug logging of lasso library X-Git-Tag: v0.2.2~34 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=98caa6ed5e8a67703d92ccd170fe1731642aa01e;ds=sidebyside Add debug logging of lasso library 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 --- diff --git a/ipsilon/providers/saml2idp.py b/ipsilon/providers/saml2idp.py index 0c8358d..1922c53 100755 --- a/ipsilon/providers/saml2idp.py +++ b/ipsilon/providers/saml2idp.py @@ -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):