Remove log translations
Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: I797b5f0374d6f8ca1cb4641246cab414aa5466dd
This commit is contained in:
parent
c4f2263d49
commit
2dc2cf3c31
@ -23,13 +23,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='oslo_middleware')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
# Translators for log levels.
|
||||
#
|
||||
# The abbreviated names are meant to reflect the usual use of a short
|
||||
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||
# the level.
|
||||
_LI = _translators.log_info
|
||||
_LW = _translators.log_warning
|
||||
_LE = _translators.log_error
|
||||
_LC = _translators.log_critical
|
||||
|
@ -19,7 +19,6 @@ import re
|
||||
import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from oslo_middleware._i18n import _LE
|
||||
from oslo_middleware import base
|
||||
|
||||
|
||||
@ -41,7 +40,7 @@ class CatchErrors(base.ConfigurableMiddleware):
|
||||
response = req.get_response(self.application)
|
||||
except Exception:
|
||||
req_str = _TOKEN_RE.sub(r'\1: *****', req.as_text())
|
||||
LOG.exception(_LE('An error occurred during '
|
||||
'processing the request: %s'), req_str)
|
||||
LOG.exception('An error occurred during '
|
||||
'processing the request: %s', req_str)
|
||||
response = webob.exc.HTTPInternalServerError()
|
||||
return response
|
||||
|
@ -16,7 +16,6 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from oslo_middleware._i18n import _LW
|
||||
from oslo_middleware.healthcheck import opts
|
||||
from oslo_middleware.healthcheck import pluginbase
|
||||
|
||||
@ -66,9 +65,9 @@ class DisableByFilesPortsHealthcheck(pluginbase.HealthcheckBaseExtension):
|
||||
def healthcheck(self, server_port):
|
||||
path = self.status_files.get(server_port)
|
||||
if not path:
|
||||
LOG.warning(_LW('DisableByFilesPorts healthcheck middleware'
|
||||
' enabled without disable_by_file_paths set'
|
||||
' for port %s') % server_port)
|
||||
LOG.warning('DisableByFilesPorts healthcheck middleware'
|
||||
' enabled without disable_by_file_paths set'
|
||||
' for port %s', server_port)
|
||||
return pluginbase.HealthcheckResult(available=True,
|
||||
reason="OK")
|
||||
else:
|
||||
@ -107,8 +106,8 @@ class DisableByFileHealthcheck(pluginbase.HealthcheckBaseExtension):
|
||||
def healthcheck(self, server_port):
|
||||
path = self._conf_get('disable_by_file_path')
|
||||
if not path:
|
||||
LOG.warning(_LW('DisableByFile healthcheck middleware enabled '
|
||||
'without disable_by_file_path set'))
|
||||
LOG.warning('DisableByFile healthcheck middleware enabled '
|
||||
'without disable_by_file_path set')
|
||||
return pluginbase.HealthcheckResult(
|
||||
available=True, reason="OK",
|
||||
details="No 'disable_by_file_path' configuration value"
|
||||
|
Loading…
x
Reference in New Issue
Block a user