feat(logging): Surpress K8s Client Python

Allow user to set logging levels, using keystone's implementation

Updated:
- armada/shell
- armada/conf/init

Closes #177

Change-Id: I5c6cc0fa33f103df77860c90a3bc8b82f5f9d61e
This commit is contained in:
Roadrunner2058 2017-11-28 15:57:51 +00:00
parent c7a4620e8e
commit 4470f4ec64

View File

@ -15,6 +15,7 @@
import os
from oslo_config import cfg
from oslo_log import log
from armada.conf import default
from armada import const
@ -27,4 +28,23 @@ if (os.path.exists(const.CONFIG_PATH)):
def set_app_default_configs():
set_default_for_default_log_levels()
default.register_opts(CONF)
def set_default_for_default_log_levels():
"""Set the default for the default_log_levels option for Armada.
Armada uses some packages that other OpenStack services don't use that do
logging. This will set the default_log_levels default level for those
packages.
This function needs to be called before CONF().
"""
extra_log_level_defaults = [
'kubernetes.client.rest=INFO'
]
log.register_options(CONF)
log.set_defaults(
default_log_levels=log.get_default_log_levels() +
extra_log_level_defaults)