Remove .main from logging
This commit is contained in:
1 parent
2eff364d7e
commit
08a456a6bf
1 file changed
+4
-5
@@ -1,3 +1,4 @@
|
|||||||
|
import color_logs
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -7,14 +8,12 @@ class CPLog():
|
|||||||
replace_private = ['api', 'apikey', 'api_key', 'password', 'username', 'h']
|
replace_private = ['api', 'apikey', 'api_key', 'password', 'username', 'h']
|
||||||
|
|
||||||
def __init__(self, context = ''):
|
def __init__(self, context = ''):
|
||||||
|
if context.endswith('.main'):
|
||||||
|
context = context[:-5]
|
||||||
|
|
||||||
self.context = context
|
self.context = context
|
||||||
self.logger = logging.getLogger()
|
self.logger = logging.getLogger()
|
||||||
|
|
||||||
try:
|
|
||||||
import color_logs
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def info(self, msg):
|
def info(self, msg):
|
||||||
self.logger.info(self.addContext(msg))
|
self.logger.info(self.addContext(msg))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user