mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
Make jwutils.log module somewhat usable
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
421ff284cb
commit
0aecc8d076
2 changed files with 57 additions and 11 deletions
|
|
@ -3,15 +3,18 @@ import jwutils.log
|
|||
class Object(object): # export
|
||||
|
||||
def __init__():
|
||||
self.log_level = jwutils.log.NOTICE
|
||||
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)
|
||||
msg += ' ' + str(*thing)
|
||||
if len(msg):
|
||||
print msg[1:]
|
||||
|
||||
def debug(self, *args):
|
||||
self.log(DEBUG, args)
|
||||
jwutils.log.slog(jwutils.log.DEBUG, args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue