Restructuring

Logging
Basic config loading from plugins/providers
This commit is contained in:
Ruud committed 2011-02-12 20:34:15 +01:00
1 parent 8be7cba417
commit 722731c8bc
14 files changed
+229 -22

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
from couchpotato import app
class CPLog():
context = ''
def __init__(self, context = ''):
self.context = context
self.logger = app.logger
def info(self, msg):
self.logger.info(self.addContext(msg))
def debug(self, msg):
self.logger.debug(self.addContext(msg))
def error(self, msg):
self.logger.error(self.addContext(msg))
def addContext(self, msg):
return '[%+25.25s] %s' % (self.context[-25:], msg)