From 72543c26a9f4cdd47180c62fad78068141f1d4ad Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 19 Jul 2018 00:03:19 +0200 Subject: [PATCH] Added logger plugin --- platypush/plugins/logger.py | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 platypush/plugins/logger.py diff --git a/platypush/plugins/logger.py b/platypush/plugins/logger.py new file mode 100644 index 000000000..efac544d6 --- /dev/null +++ b/platypush/plugins/logger.py @@ -0,0 +1,46 @@ +from platypush.plugins import Plugin, action + + +class LoggerPlugin(Plugin): + """ + Plugin to log traces on the standard Platypush logger + """ + + @action + def trace(self, msg, *args, **kwargs): + """ + logger.trace wrapper + """ + self.logger.trace(msg, *args, **kwargs) + + @action + def debug(self, msg, *args, **kwargs): + """ + logger.debug wrapper + """ + self.logger.debug(msg, *args, **kwargs) + + @action + def info(self, msg, *args, **kwargs): + """ + logger.info wrapper + """ + self.logger.info(msg, *args, **kwargs) + + @action + def warning(self, msg, *args, **kwargs): + """ + logger.warning wrapper + """ + self.logger.warning(msg, *args, **kwargs) + + @action + def error(self, msg, *args, **kwargs): + """ + logger.error wrapper + """ + self.logger.error(msg, *args, **kwargs) + + +# vim:sw=4:ts=4:et: +