log take_action parameters in a single place
Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
This commit is contained in:
@@ -31,7 +31,10 @@ class CommandMeta(abc.ABCMeta):
|
||||
|
||||
@six.add_metaclass(CommandMeta)
|
||||
class Command(command.Command):
|
||||
pass
|
||||
|
||||
def run(self, parsed_args):
|
||||
self.log.debug('run(%s)', parsed_args)
|
||||
return super(Command, self).run(parsed_args)
|
||||
|
||||
|
||||
class Lister(Command, lister.Lister):
|
||||
|
||||
@@ -13,19 +13,13 @@
|
||||
|
||||
"""Timing Implementation"""
|
||||
|
||||
import logging
|
||||
|
||||
from cliff import lister
|
||||
from openstackclient.common import command
|
||||
|
||||
|
||||
class Timing(lister.Lister):
|
||||
class Timing(command.Lister):
|
||||
"""Show timing data"""
|
||||
|
||||
log = logging.getLogger(__name__ + '.Timing')
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
self.log.debug('take_action(%s)' % parsed_args)
|
||||
|
||||
column_headers = (
|
||||
'URL',
|
||||
'Seconds',
|
||||
|
||||
Reference in New Issue
Block a user