From 5bdbd6fc5b3f1aac00e20958c2d1307dd36a9f44 Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Thu, 28 Dec 2017 11:42:07 +0100 Subject: Clean the code Change-Id: If508aa1ac6fd439dc6da916868b60adfce3dd72d --- .../python_moonutilities/exceptions.py | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'python_moonutilities/python_moonutilities/exceptions.py') diff --git a/python_moonutilities/python_moonutilities/exceptions.py b/python_moonutilities/python_moonutilities/exceptions.py index dab398cf..f14d6abf 100644 --- a/python_moonutilities/python_moonutilities/exceptions.py +++ b/python_moonutilities/python_moonutilities/exceptions.py @@ -6,7 +6,7 @@ from oslo_log import log as logging from werkzeug.exceptions import HTTPException -LOG = logging.getLogger("moon.utilities.exceptions") +logger = logging.getLogger("moon.utilities.exceptions") _ = str @@ -40,30 +40,30 @@ class MoonError(HTTPException): message = "{} ({}) {}".format(self.hierarchy, self.description, self.payload) if self.logger == "ERROR": try: - LOG.error(message) + logger.error(message) except AttributeError: - LOG.error(message) + logger.error(message) elif self.logger == "WARNING": try: - LOG.warning(message) + logger.warning(message) except AttributeError: - LOG.warning(message) + logger.warning(message) elif self.logger == "CRITICAL": try: - LOG.critical(message) + logger.critical(message) except AttributeError: - LOG.critical(message) + logger.critical(message) elif self.logger == "AUTHZ": try: - LOG.authz(self.hierarchy) - LOG.error(message) + logger.authz(self.hierarchy) + logger.error(message) except AttributeError: - LOG.error(message) + logger.error(message) else: try: - LOG.info(message) + logger.info(message) except AttributeError: - LOG.info(message) + logger.info(message) # def to_dict(self): # rv = dict(self.payload or ()) -- cgit 1.2.3-korg