jw-python/tools/python/jwutils/Object.py
Jan Lindemann 952bf4a4e1 Fix Python errors reported by mypy
This commit fixes Python errors and warnings reported by static type checking
with mypy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-04-10 14:17:15 +02:00

21 lines
579 B
Python

from __future__ import print_function
import jwutils.log
class Object(object): # export
def __init__(self):
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)