Add _debug facility to the Page class
authorSimo Sorce <simo@redhat.com>
Tue, 25 Feb 2014 00:58:10 +0000 (19:58 -0500)
committerSimo Sorce <simo@redhat.com>
Tue, 25 Feb 2014 01:30:06 +0000 (20:30 -0500)
Use this instead of th misleading "_log" name. These really are just
debugging statements not normal logging.

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/login/common.py
ipsilon/util/page.py

index 578ec63..4888060 100755 (executable)
@@ -79,14 +79,14 @@ class Login(Page):
         plugins = self._site[FACILITY]
 
         available = plugins['available'].keys()
-        self._log('Available login managers: %s' % str(available))
+        self._debug('Available login managers: %s' % str(available))
 
         prev_obj = None
         for item in plugins['whitelist']:
-            self._log('Login plugin in whitelist: %s' % item)
+            self._debug('Login plugin in whitelist: %s' % item)
             if item not in plugins['available']:
                 continue
-            self._log('Login plugin enabled: %s' % item)
+            self._debug('Login plugin enabled: %s' % item)
             plugins['enabled'].append(item)
             obj = plugins['available'][item]
             if prev_obj:
@@ -98,10 +98,6 @@ class Login(Page):
                 obj.set_config(plugins['config'][item])
             self.__dict__[item] = obj.get_tree(self._site)
 
-    def _log(self, fact):
-        if cherrypy.config.get('debug', False):
-            cherrypy.log(fact)
-
     def root(self, *args, **kwargs):
         if self.first_login:
             raise cherrypy.HTTPRedirect('%s/login/%s' %
index 2cdca1c..56a6463 100755 (executable)
@@ -62,6 +62,10 @@ class Page(object):
         m.update(kwargs)
         return t.render(**m)
 
+    def _debug(self, fact):
+        if cherrypy.config.get('debug', False):
+            cherrypy.log(fact)
+
     def default(self, *args, **kwargs):
         raise cherrypy.HTTPError(404)