aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2012-09-08 01:40:12 +0200
committerGravatar Christopher Rosell <chrippa@tanuki.se>2012-09-08 14:32:47 +0200
commit2b4932c6626be2a3d08757719306e90bf264c0b2 (patch)
treef50521896bf6bd9bac5a01654c5c123946bb0d13
parent7ce4938cff4b4f352cc2cade258391be2771fede (diff)
Make logger handle both args and keyword args.
-rw-r--r--src/livestreamer/logger.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/livestreamer/logger.py b/src/livestreamer/logger.py
index 53519d3..f11bdc2 100644
--- a/src/livestreamer/logger.py
+++ b/src/livestreamer/logger.py
@@ -22,11 +22,11 @@ class Logger(object):
def set_output(self, output):
self.output = output
- def msg(self, module, level, msg, *args):
+ def msg(self, module, level, msg, *args, **kw):
if self.level < level or level > len(Logger.Levels):
return
- msg = msg.format(*args)
+ msg = msg.format(*args, **kw)
self.output.write(Logger.Format.format(module=module,
level=Logger.Levels[level],
@@ -38,16 +38,16 @@ class LoggerModule(object):
self.manager = manager
self.module = module
- def error(self, msg, *args):
- self.manager.msg(self.module, 1, msg, *args)
+ def error(self, msg, *args, **kw):
+ self.manager.msg(self.module, 1, msg, *args, **kw)
- def warning(self, msg, *args):
- self.manager.msg(self.module, 2, msg, *args)
+ def warning(self, msg, *args, **kw):
+ self.manager.msg(self.module, 2, msg, *args, **kw)
- def info(self, msg, *args):
- self.manager.msg(self.module, 3, msg, *args)
+ def info(self, msg, *args, **kw):
+ self.manager.msg(self.module, 3, msg, *args, **kw)
- def debug(self, msg, *args):
- self.manager.msg(self.module, 4, msg, *args)
+ def debug(self, msg, *args, **kw):
+ self.manager.msg(self.module, 4, msg, *args, **kw)
__all__ = ["Logger"]