From 734323ca25765e6eecfa63e41b7f3ec12b084ca3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 27 Jun 2014 20:17:00 -0400 Subject: [PATCH] Add Log class that can be inherited from safely Signed-off-by: Simo Sorce Reviewed-by: Patrick Uiterwijk --- ipsilon/util/log.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 ipsilon/util/log.py 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) -- 2.20.1