summaryrefslogtreecommitdiffstats
path: root/ipsilon
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-06-27 20:17:00 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-08-27 18:14:52 -0400
commit734323ca25765e6eecfa63e41b7f3ec12b084ca3 (patch)
treecc537f38f01b6d8406f5a275d4fddaa255a5c5f0 /ipsilon
parent1ec8e6299c1c4a270a7b6ebf6916d938923cc72c (diff)
downloadipsilon-734323ca25765e6eecfa63e41b7f3ec12b084ca3.tar.gz
ipsilon-734323ca25765e6eecfa63e41b7f3ec12b084ca3.tar.xz
ipsilon-734323ca25765e6eecfa63e41b7f3ec12b084ca3.zip
Add Log class that can be inherited from safely
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon')
-rwxr-xr-xipsilon/util/log.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/ipsilon/util/log.py b/ipsilon/util/log.py
new file mode 100755
index 0000000..3000bb5
--- /dev/null
+++ b/ipsilon/util/log.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014 Ipsilon Project Contributors
+#
+# See the file named COPYING for the project license
+
+import cherrypy
+
+
+class Log(object):
+
+ def debug(self, fact):
+ if cherrypy.config.get('debug', False):
+ cherrypy.log(fact)
+
+ # for compatibility with existing code
+ _debug = debug
+
+ def log(self, fact):
+ cherrypy.log(fact)