diff options
author | Thomas Duval <thomas.duval@orange.com> | 2017-12-28 11:42:07 +0100 |
---|---|---|
committer | Thomas Duval <thomas.duval@orange.com> | 2017-12-28 14:28:00 +0100 |
commit | 5bdbd6fc5b3f1aac00e20958c2d1307dd36a9f44 (patch) | |
tree | a6c28f48388efc68d42ad95dd8acf6bb23089798 /python_moonutilities/python_moonutilities/exceptions.py | |
parent | 9cf58823b4fa426816acfef81a562054d26afde8 (diff) |
Clean the code
Change-Id: If508aa1ac6fd439dc6da916868b60adfce3dd72d
Diffstat (limited to 'python_moonutilities/python_moonutilities/exceptions.py')
-rw-r--r-- | python_moonutilities/python_moonutilities/exceptions.py | 24 |
1 files changed, 12 insertions, 12 deletions
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 ()) |