blob: dc557e3ccfe3a6c20238e9e0c12c53dc79b20c4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/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):
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)
|