From 047cb6849354f4fdf8d365bd109a0ed56a77d200 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Thu, 16 Jun 2016 20:01:15 +0800 Subject: Standardize logger usage Use file logger for all command specific logs. This patch also fixes some usage that doesn't follow rules in: http://docs.openstack.org/developer/oslo.i18n/guidelines.html After this patch, all self.log and self.app.log will be standardized to LOG(). NOTE: In shell.py, we got the log in class OpenStackShell, which is also known as self.app.log in other classes. This logger is used to record non-command-specific logs. So we leave it as-is. Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896 Implements: blueprint log-usage --- openstackclient/identity/v3/mapping.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'openstackclient/identity/v3/mapping.py') diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index 5937474e..74ead228 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -16,6 +16,7 @@ """Identity v3 federation mapping action implementations""" import json +import logging from osc_lib.command import command from osc_lib import exceptions @@ -25,6 +26,9 @@ import six from openstackclient.i18n import _ +LOG = logging.getLogger(__name__) + + class _RulesReader(object): """Helper class capable of reading rules from files""" @@ -159,7 +163,7 @@ class SetMapping(command.Command, _RulesReader): identity_client = self.app.client_manager.identity if not parsed_args.rules: - self.app.log.error(_("No changes requested")) + LOG.error(_("No changes requested")) return rules = self._read_rules(parsed_args.rules) -- cgit v1.2.1