1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 23:14:23 +00:00

better log for debugging

This commit is contained in:
deadc0de6
2018-07-17 08:37:37 +02:00
parent 2243ddfc64
commit c8a37c1302
4 changed files with 43 additions and 28 deletions

View File

@@ -19,8 +19,8 @@ class Logger:
RESET = '\033[0m'
EMPH = '\033[33m'
def __init__(self, debug=False):
self.debug = debug
def __init__(self):
pass
def log(self, string, end='\n', pre=''):
cs = self._color(self.BLUE)
@@ -48,8 +48,6 @@ class Logger:
sys.stderr.write('{}[WARN] {} {}{}'.format(cs, string, end, ce))
def dbg(self, string):
if not self.debug:
return
frame = inspect.stack()[1]
mod = inspect.getmodule(frame[0]).__name__
func = inspect.stack()[1][3]