From 2b73f718032310c9ed9778231f7a73a38b37bc9f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 14 Jun 2018 02:19:55 +0200 Subject: [PATCH] Improved logging traces names for backends and plugins --- platypush/backend/__init__.py | 2 +- platypush/plugins/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/backend/__init__.py b/platypush/backend/__init__.py index 1e0740330..f7dc225b7 100644 --- a/platypush/backend/__init__.py +++ b/platypush/backend/__init__.py @@ -34,7 +34,7 @@ class Backend(Thread): self.thread_id = None self._stop = False self._kwargs = kwargs - self.logger = logging.getLogger(__name__) + self.logger = logging.getLogger(self.__class__.__name__) # Internal-only, we set the request context on a backend if that # backend is intended to react for a response to a specific request diff --git a/platypush/plugins/__init__.py b/platypush/plugins/__init__.py index f20d9eaca..e5df9d73a 100644 --- a/platypush/plugins/__init__.py +++ b/platypush/plugins/__init__.py @@ -9,7 +9,7 @@ class Plugin(object): """ Base plugin class """ def __init__(self, **kwargs): - self.logger = logging.getLogger(__name__) + self.logger = logging.getLogger(self.__class__.__name__) if 'logging' in kwargs: self.logger.setLevel(getattr(logging, kwargs['logging'].upper()))