From a53e7a82e38b3a2288f8daccc960022c727e4ef9 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Wed, 9 Oct 2019 09:16:35 +0700 Subject: [PATCH] Added 'actor' among the fields of the structured log messages; minor other fixes --- pisa/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pisa/__init__.py b/pisa/__init__.py index 77ae6b2..2dcde22 100644 --- a/pisa/__init__.py +++ b/pisa/__init__.py @@ -26,14 +26,14 @@ class Logger(object): def _add_prefix(self, msg): return msg if self.actor is None else "[{}] {}".format(self.actor, msg) - def info(msg, **kwargs): - logging.info(StructuredMessage(self._add_prefix(msg), **kwargs)) + def info(self, msg, **kwargs): + logging.info(StructuredMessage(self._add_prefix(msg), actor=self.actor, **kwargs)) - def debug(msg, **kwargs): - logging.debug(StructuredMessage(self._add_prefix(msg), **kwargs)) + def debug(self, msg, **kwargs): + logging.debug(StructuredMessage(self._add_prefix(msg), actor=self.actor, **kwargs)) - def error(msg, **kwargs): - logging.error(StructuredMessage(self._add_prefix(msg), **kwargs)) + def error(self, msg, **kwargs): + logging.error(StructuredMessage(self._add_prefix(msg), actor=self.actor, **kwargs)) # Configure logging logging.basicConfig(format='%(message)s', level=logging.INFO, handlers=[