Don't translate debug level logs in nova.cmd and nova.db

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

Change-Id: I8fa50e469384f4b626ae6aa47e9ca0b8e29da404
This commit is contained in:
Gary Kotton 2014-04-27 07:18:41 -07:00 committed by garyk
parent a0474f0e4c
commit fc66b094db
2 changed files with 8 additions and 6 deletions

View File

@ -3137,12 +3137,12 @@ def quota_reserve(context, resources, project_quotas, user_quotas, deltas,
session=session)
if user_usages[res].in_use != in_use:
LOG.debug(_('quota_usages out of sync, updating. '
'project_id: %(project_id)s, '
'user_id: %(user_id)s, '
'resource: %(res)s, '
'tracked usage: %(tracked_use)s, '
'actual usage: %(in_use)s'),
LOG.debug('quota_usages out of sync, updating. '
'project_id: %(project_id)s, '
'user_id: %(user_id)s, '
'resource: %(res)s, '
'tracked usage: %(tracked_use)s, '
'actual usage: %(in_use)s',
{'project_id': project_id,
'user_id': user_id,
'res': res,

View File

@ -214,6 +214,8 @@ def no_translate_debug_logs(logical_line, filename):
"nova/conductor",
"nova/compute",
"nova/objects",
"nova/cmd",
"nova/db",
]
if max([name in filename for name in dirs]):
if logical_line.startswith("LOG.debug(_("):