From e3c46ece4a496584a54b9d39b55921990db4a7b3 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 1 Sep 2015 16:43:07 -0700 Subject: Use a common decorator to log 'take_action' activation Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79 --- openstackclient/common/module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'openstackclient/common/module.py') diff --git a/openstackclient/common/module.py b/openstackclient/common/module.py index 356cdca3..f0ed23b2 100644 --- a/openstackclient/common/module.py +++ b/openstackclient/common/module.py @@ -22,6 +22,8 @@ import sys from cliff import lister from cliff import show +from openstackclient.common import utils + class ListCommand(lister.Lister): """List recognized commands by group""" @@ -29,8 +31,8 @@ class ListCommand(lister.Lister): auth_required = False log = logging.getLogger(__name__ + '.ListCommand') + @utils.log_method(log) def take_action(self, parsed_args): - self.log.debug('take_action(%s)', parsed_args) cm = self.app.command_manager groups = cm.get_command_groups() @@ -54,8 +56,8 @@ class ListModule(show.ShowOne): ) return parser + @utils.log_method(log) def take_action(self, parsed_args): - self.log.debug('take_action(%s)', parsed_args) data = {} # Get module versions -- cgit v1.2.1