debug level logs should not be translated

According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: I082f925e6923613e1e8cfeb5a0533747087a5e02
This commit is contained in:
Christian Berendt 2014-05-12 17:15:06 +02:00
parent 4603c2a48d
commit 939fbc4463
7 changed files with 35 additions and 35 deletions

View File

@ -47,19 +47,19 @@ class VersionNegotiationFilter(wsgi.Middleware):
args = {'method': req.method, 'path': req.path, 'accept': req.accept} args = {'method': req.method, 'path': req.path, 'accept': req.accept}
LOG.debug(msg % args) LOG.debug(msg % args)
LOG.debug(_("Using url versioning")) LOG.debug("Using url versioning")
# Remove version in url so it doesn't conflict later # Remove version in url so it doesn't conflict later
req_version = self._pop_path_info(req) req_version = self._pop_path_info(req)
try: try:
version = self._match_version_string(req_version) version = self._match_version_string(req_version)
except ValueError: except ValueError:
LOG.debug(_("Unknown version. Returning version choices.")) LOG.debug("Unknown version. Returning version choices.")
return self.versions_app return self.versions_app
req.environ['api.version'] = version req.environ['api.version'] = version
req.path_info = ''.join(('/v', str(version), req.path_info)) req.path_info = ''.join(('/v', str(version), req.path_info))
LOG.debug(_("Matched version: v%d"), version) LOG.debug("Matched version: v%d", version)
LOG.debug('new path %s' % req.path_info) LOG.debug('new path %s' % req.path_info)
return None return None

View File

@ -35,7 +35,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Index') @request_statistics.stats_count(API_NAME, 'Index')
def index(self, request): def index(self, request):
LOG.debug(_('Environments:List')) LOG.debug('Environments:List')
#Only environments from same tenant as user should be returned #Only environments from same tenant as user should be returned
filters = {'tenant_id': request.context.tenant} filters = {'tenant_id': request.context.tenant}
@ -46,7 +46,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Create') @request_statistics.stats_count(API_NAME, 'Create')
def create(self, request, body): def create(self, request, body):
LOG.debug(_('Environments:Create <Body {0}>').format(body)) LOG.debug('Environments:Create <Body {0}>'.format(body))
environment = envs.EnvironmentServices.create(body.copy(), environment = envs.EnvironmentServices.create(body.copy(),
request.context.tenant) request.context.tenant)
@ -55,7 +55,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Show') @request_statistics.stats_count(API_NAME, 'Show')
def show(self, request, environment_id): def show(self, request, environment_id):
LOG.debug(_('Environments:Show <Id: {0}>').format(environment_id)) LOG.debug('Environments:Show <Id: {0}>'.format(environment_id))
session = db_session.get_session() session = db_session.get_session()
environment = session.query(models.Environment).get(environment_id) environment = session.query(models.Environment).get(environment_id)
@ -85,8 +85,8 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Update') @request_statistics.stats_count(API_NAME, 'Update')
def update(self, request, environment_id, body): def update(self, request, environment_id, body):
LOG.debug(_('Environments:Update <Id: {0}, ' LOG.debug('Environments:Update <Id: {0}, '
'Body: {1}>').format(environment_id, body)) 'Body: {1}>'.format(environment_id, body))
session = db_session.get_session() session = db_session.get_session()
environment = session.query(models.Environment).get(environment_id) environment = session.query(models.Environment).get(environment_id)
@ -108,7 +108,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Delete') @request_statistics.stats_count(API_NAME, 'Delete')
def delete(self, request, environment_id): def delete(self, request, environment_id):
LOG.debug(_('Environments:Delete <Id: {0}>').format(environment_id)) LOG.debug('Environments:Delete <Id: {0}>'.format(environment_id))
unit = db_session.get_session() unit = db_session.get_session()
environment = unit.query(models.Environment).get(environment_id) environment = unit.query(models.Environment).get(environment_id)

View File

@ -27,7 +27,7 @@ API_NAME = 'EnvironmentStatistics'
class Controller(object): class Controller(object):
@request_statistics.stats_count(API_NAME, 'GetAggregated') @request_statistics.stats_count(API_NAME, 'GetAggregated')
def get_aggregated(self, request, environment_id): def get_aggregated(self, request, environment_id):
LOG.debug(_('EnvironmentStatistics:GetAggregated')) LOG.debug('EnvironmentStatistics:GetAggregated')
# TODO (stanlagun): Check that caller is authorized to access # TODO (stanlagun): Check that caller is authorized to access
# tenant's statistics # tenant's statistics
@ -37,7 +37,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'GetForInstance') @request_statistics.stats_count(API_NAME, 'GetForInstance')
def get_for_instance(self, request, environment_id, instance_id): def get_for_instance(self, request, environment_id, instance_id):
LOG.debug(_('EnvironmentStatistics:GetForInstance')) LOG.debug('EnvironmentStatistics:GetForInstance')
# TODO (stanlagun): Check that caller is authorized to access # TODO (stanlagun): Check that caller is authorized to access
# tenant's statistics # tenant's statistics
@ -47,7 +47,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'GetForEnvironment') @request_statistics.stats_count(API_NAME, 'GetForEnvironment')
def get_for_environment(self, request, environment_id): def get_for_environment(self, request, environment_id):
LOG.debug(_('EnvironmentStatistics:GetForEnvironment')) LOG.debug('EnvironmentStatistics:GetForEnvironment')
# TODO (stanlagun): Check that caller is authorized to access # TODO (stanlagun): Check that caller is authorized to access
# tenant's statistics # tenant's statistics

View File

@ -48,8 +48,8 @@ class Controller(object):
@utils.verify_env @utils.verify_env
@normalize_path @normalize_path
def get(self, request, environment_id, path): def get(self, request, environment_id, path):
LOG.debug(_('Services:Get <EnvId: {0}, ' LOG.debug('Services:Get <EnvId: {0}, '
'Path: {1}>').format(environment_id, path)) 'Path: {1}>'.format(environment_id, path))
session_id = None session_id = None
if hasattr(request, 'context') and request.context.session: if hasattr(request, 'context') and request.context.session:
@ -69,8 +69,8 @@ class Controller(object):
@normalize_path @normalize_path
def post(self, request, environment_id, path, body): def post(self, request, environment_id, path, body):
secure_data = token_sanitizer.TokenSanitizer().sanitize(body) secure_data = token_sanitizer.TokenSanitizer().sanitize(body)
LOG.debug(_('Services:Post <EnvId: {0}, Path: {2}, ' LOG.debug('Services:Post <EnvId: {0}, Path: {2}, '
'Body: {1}>').format(environment_id, secure_data, path)) 'Body: {1}>'.format(environment_id, secure_data, path))
post_data = core_services.CoreServices.post_data post_data = core_services.CoreServices.post_data
session_id = request.context.session session_id = request.context.session
@ -85,8 +85,8 @@ class Controller(object):
@utils.verify_env @utils.verify_env
@normalize_path @normalize_path
def put(self, request, environment_id, path, body): def put(self, request, environment_id, path, body):
LOG.debug(_('Services:Put <EnvId: {0}, Path: {2}, ' LOG.debug('Services:Put <EnvId: {0}, Path: {2}, '
'Body: {1}>').format(environment_id, body, path)) 'Body: {1}>'.format(environment_id, body, path))
put_data = core_services.CoreServices.put_data put_data = core_services.CoreServices.put_data
session_id = request.context.session session_id = request.context.session
@ -102,8 +102,8 @@ class Controller(object):
@utils.verify_env @utils.verify_env
@normalize_path @normalize_path
def delete(self, request, environment_id, path): def delete(self, request, environment_id, path):
LOG.debug(_('Services:Put <EnvId: {0}, ' LOG.debug('Services:Put <EnvId: {0}, '
'Path: {1}>').format(environment_id, path)) 'Path: {1}>'.format(environment_id, path))
delete_data = core_services.CoreServices.delete_data delete_data = core_services.CoreServices.delete_data
session_id = request.context.session session_id = request.context.session

View File

@ -32,7 +32,7 @@ API_NAME = 'Sessions'
class Controller(object): class Controller(object):
@request_statistics.stats_count(API_NAME, 'Create') @request_statistics.stats_count(API_NAME, 'Create')
def configure(self, request, environment_id): def configure(self, request, environment_id):
LOG.debug(_('Session:Configure <EnvId: {0}>').format(environment_id)) LOG.debug('Session:Configure <EnvId: {0}>'.format(environment_id))
unit = db_session.get_session() unit = db_session.get_session()
environment = unit.query(models.Environment).get(environment_id) environment = unit.query(models.Environment).get(environment_id)
@ -62,7 +62,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Index') @request_statistics.stats_count(API_NAME, 'Index')
def show(self, request, environment_id, session_id): def show(self, request, environment_id, session_id):
LOG.debug(_('Session:Show <SessionId: {0}>').format(session_id)) LOG.debug('Session:Show <SessionId: {0}>'.format(session_id))
unit = db_session.get_session() unit = db_session.get_session()
session = unit.query(models.Session).get(session_id) session = unit.query(models.Session).get(session_id)
@ -92,7 +92,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Delete') @request_statistics.stats_count(API_NAME, 'Delete')
def delete(self, request, environment_id, session_id): def delete(self, request, environment_id, session_id):
LOG.debug(_('Session:Delete <SessionId: {0}>').format(session_id)) LOG.debug('Session:Delete <SessionId: {0}>'.format(session_id))
unit = db_session.get_session() unit = db_session.get_session()
session = unit.query(models.Session).get(session_id) session = unit.query(models.Session).get(session_id)
@ -125,7 +125,7 @@ class Controller(object):
@request_statistics.stats_count(API_NAME, 'Deploy') @request_statistics.stats_count(API_NAME, 'Deploy')
def deploy(self, request, environment_id, session_id): def deploy(self, request, environment_id, session_id):
LOG.debug(_('Session:Deploy <SessionId: {0}>').format(session_id)) LOG.debug('Session:Deploy <SessionId: {0}>'.format(session_id))
unit = db_session.get_session() unit = db_session.get_session()
session = unit.query(models.Session).get(session_id) session = unit.query(models.Session).get(session_id)

View File

@ -40,14 +40,14 @@ class ResultEndpoint(object):
@staticmethod @staticmethod
def process_result(context, result): def process_result(context, result):
secure_result = token_sanitizer.TokenSanitizer().sanitize(result) secure_result = token_sanitizer.TokenSanitizer().sanitize(result)
LOG.debug(_('Got result from orchestration ' LOG.debug('Got result from orchestration '
'engine:\n{0}').format(secure_result)) 'engine:\n{0}'.format(secure_result))
result_id = result['Objects']['?']['id'] result_id = result['Objects']['?']['id']
if 'deleted' in result: if 'deleted' in result:
LOG.debug(_('Result for environment {0} is dropped. Environment ' LOG.debug('Result for environment {0} is dropped. Environment '
'is deleted').format(result_id)) 'is deleted'.format(result_id))
return return
unit = session.get_session() unit = session.get_session()
@ -115,8 +115,8 @@ def notification_endpoint_wrapper(priority='info'):
@notification_endpoint_wrapper() @notification_endpoint_wrapper()
def track_instance(payload): def track_instance(payload):
LOG.debug(_('Got track instance request from orchestration ' LOG.debug('Got track instance request from orchestration '
'engine:\n{0}').format(payload)) 'engine:\n{0}'.format(payload))
instance_id = payload['instance'] instance_id = payload['instance']
instance_type = payload.get('instance_type', 0) instance_type = payload.get('instance_type', 0)
environment_id = payload['environment'] environment_id = payload['environment']
@ -131,8 +131,8 @@ def track_instance(payload):
@notification_endpoint_wrapper() @notification_endpoint_wrapper()
def untrack_instance(payload): def untrack_instance(payload):
LOG.debug(_('Got untrack instance request from orchestration ' LOG.debug('Got untrack instance request from orchestration '
'engine:\n{0}').format(payload)) 'engine:\n{0}'.format(payload))
instance_id = payload['instance'] instance_id = payload['instance']
environment_id = payload['environment'] environment_id = payload['environment']
instances.InstanceStatsServices.destroy_instance( instances.InstanceStatsServices.destroy_instance(
@ -141,8 +141,8 @@ def untrack_instance(payload):
@notification_endpoint_wrapper() @notification_endpoint_wrapper()
def report_notification(report): def report_notification(report):
LOG.debug(_('Got report from orchestration ' LOG.debug('Got report from orchestration '
'engine:\n{0}').format(report)) 'engine:\n{0}'.format(report))
report['entity_id'] = report['id'] report['entity_id'] = report['id']
del report['id'] del report['id']

View File

@ -54,7 +54,7 @@ class StatsCollectingService(service.Service):
eventlet.sleep(period) eventlet.sleep(period)
def update_stats(self): def update_stats(self):
LOG.debug(_("Updating statistic information.")) LOG.debug("Updating statistic information.")
LOG.debug("Stats object: %s" % v1.stats) LOG.debug("Stats object: %s" % v1.stats)
LOG.debug("Stats: Requests:%s Errors: %s Ave.Res.Time %2.4f\n" LOG.debug("Stats: Requests:%s Errors: %s Ave.Res.Time %2.4f\n"
"Per tenant: %s" % "Per tenant: %s" %