X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=ipsilon%2Futil%2Flog.py;h=fb2c620b16305131136418d4a0ce503260115763;hb=45cb73a21a90084818c3057e362ef9459f1600f3;hp=3000bb5aa878a22b122fa9cba6d5610229c6bd10;hpb=734323ca25765e6eecfa63e41b7f3ec12b084ca3;p=cascardo%2Fipsilon.git diff --git a/ipsilon/util/log.py b/ipsilon/util/log.py old mode 100755 new mode 100644 index 3000bb5..fb2c620 --- a/ipsilon/util/log.py +++ b/ipsilon/util/log.py @@ -1,20 +1,23 @@ -#!/usr/bin/python -# # Copyright (C) 2014 Ipsilon Project Contributors # # See the file named COPYING for the project license import cherrypy +import inspect class Log(object): def debug(self, fact): if cherrypy.config.get('debug', False): - cherrypy.log(fact) + s = inspect.stack() + cherrypy.log('DEBUG(%s): %s' % (s[1][3], fact)) # for compatibility with existing code _debug = debug def log(self, fact): cherrypy.log(fact) + + def error(self, fact): + cherrypy.log.error('ERROR: %s' % fact)