From fc66b094dba069a2b865751c2328212e8751666e Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Sun, 27 Apr 2014 07:18:41 -0700 Subject: [PATCH] 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 --- nova/db/sqlalchemy/api.py | 12 ++++++------ nova/hacking/checks.py | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index ea10c8c7e4..332cfe36c3 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -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, diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py index 743624666f..677a6bd06d 100644 --- a/nova/hacking/checks.py +++ b/nova/hacking/checks.py @@ -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(_("):