Fix file permissions and remove shebang's
[cascardo/ipsilon.git] / ipsilon / util / log.py
1 # Copyright (C) 2014 Ipsilon Project Contributors
2 #
3 # See the file named COPYING for the project license
4
5 import cherrypy
6 import inspect
7
8
9 class Log(object):
10
11     def debug(self, fact):
12         if cherrypy.config.get('debug', False):
13             s = inspect.stack()
14             cherrypy.log('DEBUG(%s): %s' % (s[1][3], fact))
15
16     # for compatibility with existing code
17     _debug = debug
18
19     def log(self, fact):
20         cherrypy.log(fact)
21
22     def error(self, fact):
23         cherrypy.log.error('ERROR: %s' % fact)