jw-python/tools/python/jwutils/Object.py
Jan Lindemann 0aecc8d076 Make jwutils.log module somewhat usable
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-08-07 18:05:53 +02:00

20 lines
536 B
Python

import jwutils.log
class Object(object): # export
def __init__():
self.log_level = jwutils.log.level
def log(self, prio, *args):
if self.log_level == jwutils.log.level:
jwutils.log.slog(prio, args)
return
if prio <= self.log_level:
msg = ""
for count, thing in enumerate(args):
msg += ' ' + str(*thing)
if len(msg):
print msg[1:]
def debug(self, *args):
jwutils.log.slog(jwutils.log.DEBUG, args)