From 98caa6ed5e8a67703d92ccd170fe1731642aa01e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 11 Apr 2014 16:36:16 -0400 Subject: [PATCH] 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 --- ipsilon/providers/saml2idp.py | 7 +++++++ 1 file changed, 7 insertions(+) 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): -- 2.20.1