Restructuring
Logging Basic config loading from plugins/providers
This commit is contained in:
1 parent
8be7cba417
commit
722731c8bc
14 files changed
+229
-22
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user