Skip to content

Commit 8ba7445

Browse files
author
Dean Troyer
committed
Adjust some logging levels
* Promote select messages to INFO so lower logging levels can be useful * Help more modules not say so much all the time Change-Id: I814023c1489595998ae74efe40ef439b3522ee74
1 parent d07ae42 commit 8ba7445

2 files changed

Lines changed: 24 additions & 15 deletions

File tree

‎openstackclient/common/clientmanager.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(
118118
root_logger = logging.getLogger('')
119119
LOG.setLevel(root_logger.getEffectiveLevel())
120120

121-
LOG.debug('Using auth plugin: %s' % self.auth_plugin_name)
121+
LOG.info('Using auth plugin: %s' % self.auth_plugin_name)
122122
self.auth = auth_plugin.load_from_options(**self._auth_params)
123123
# needed by SAML authentication
124124
request_session = requests.session()

‎openstackclient/shell.py‎

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,7 @@ def configure_logging(self):
137137
super(OpenStackShell, self).configure_logging()
138138
root_logger = logging.getLogger('')
139139

140-
# Requests logs some stuff at INFO that we don't want
141-
# unless we have DEBUG
142-
requests_log = logging.getLogger("requests")
143-
requests_log.setLevel(logging.ERROR)
144-
145-
# Other modules we don't want DEBUG output for so
146-
# don't reset them below
147-
iso8601_log = logging.getLogger("iso8601")
148-
iso8601_log.setLevel(logging.ERROR)
149-
150140
# Set logging to the requested level
151-
self.dump_stack_trace = False
152141
if self.options.verbose_level == 0:
153142
# --quiet
154143
root_logger.setLevel(logging.ERROR)
@@ -161,11 +150,28 @@ def configure_logging(self):
161150
elif self.options.verbose_level >= 3:
162151
# Two or more --verbose
163152
root_logger.setLevel(logging.DEBUG)
164-
requests_log.setLevel(logging.DEBUG)
153+
154+
# Requests logs some stuff at INFO that we don't want
155+
# unless we have DEBUG
156+
requests_log = logging.getLogger("requests")
157+
158+
# Other modules we don't want DEBUG output for
159+
cliff_log = logging.getLogger('cliff')
160+
stevedore_log = logging.getLogger('stevedore')
161+
iso8601_log = logging.getLogger("iso8601")
165162

166163
if self.options.debug:
167164
# --debug forces traceback
168165
self.dump_stack_trace = True
166+
requests_log.setLevel(logging.DEBUG)
167+
cliff_log.setLevel(logging.DEBUG)
168+
else:
169+
self.dump_stack_trace = False
170+
requests_log.setLevel(logging.ERROR)
171+
cliff_log.setLevel(logging.ERROR)
172+
173+
stevedore_log.setLevel(logging.ERROR)
174+
iso8601_log.setLevel(logging.ERROR)
169175

170176
def run(self, argv):
171177
try:
@@ -295,8 +301,11 @@ def initialize_app(self, argv):
295301

296302
def prepare_to_run_command(self, cmd):
297303
"""Set up auth and API versions"""
298-
self.log.debug('prepare_to_run_command %s', cmd.__class__.__name__)
299-
304+
self.log.info(
305+
'command: %s.%s',
306+
cmd.__class__.__module__,
307+
cmd.__class__.__name__,
308+
)
300309
if cmd.auth_required and cmd.best_effort:
301310
try:
302311
# Trigger the Identity client to initialize

0 commit comments

Comments
 (0)