本文整理汇总了Python中oslo_log.log.get_default_log_levels方法的典型用法代码示例。如果您正苦于以下问题:Python log.get_default_log_levels方法的具体用法?Python log.get_default_log_levels怎么用?Python log.get_default_log_levels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oslo_log.log
的用法示例。
在下文中一共展示了log.get_default_log_levels方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_args
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def parse_args(argv, default_config_files=None, configure_db=True,
init_rpc=True):
log.register_options(CONF)
# We use the oslo.log default log levels which includes suds=INFO
# and add only the extra levels that Masakari needs
log.set_defaults(default_log_levels=log.get_default_log_levels())
rpc.set_defaults(control_exchange='masakari')
config.set_middleware_defaults()
CONF(argv[1:],
project='masakari',
version=version.version_string(),
default_config_files=default_config_files)
if init_rpc:
rpc.init(CONF)
if configure_db:
sqlalchemy_api.configure(CONF)
示例2: setup_logging
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def setup_logging():
logging.setup(CONF, 'kuryr-kubernetes')
logging.set_defaults(default_log_levels=logging.get_default_log_levels())
version_k8s = version.version_info.version_string()
LOG.info("Logging enabled!")
LOG.info("%(prog)s version %(version)s",
{'prog': sys.argv[0], 'version': version_k8s})
示例3: setup_logging
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def setup_logging(conf):
"""Sets up the logging options for a log with supplied name.
:param conf: a cfg.ConfOpts object
"""
logging.set_defaults(default_log_levels=logging.get_default_log_levels() +
EXTRA_LOG_LEVEL_DEFAULTS)
product_name = "octavia"
logging.setup(conf, product_name)
LOG.info("Logging enabled!")
LOG.info("%(prog)s version %(version)s",
{'prog': sys.argv[0],
'version': version.version_info.release_string()})
LOG.debug("command line: %s", " ".join(sys.argv))
示例4: set_default_for_default_log_levels
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
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.set_defaults(
default_log_levels=log.get_default_log_levels()
+ extra_log_level_defaults, )
示例5: set_default_for_default_log_levels
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
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.set_defaults(
default_log_levels=log.get_default_log_levels() +
extra_log_level_defaults)
示例6: set_request_context
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def set_request_context(self):
level = self.conf_log.get('log_level')
logging.set_defaults(
logging_context_format_string=self.conf_log.get(
"logging_context_format_string"),
default_log_levels=logging.get_default_log_levels() +
['controller=' + level])
context.RequestContext()
return
示例7: test_default_log_level_method
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def test_default_log_level_method(self):
self.assertEqual(_options.DEFAULT_LOG_LEVELS,
log.get_default_log_levels())
示例8: prepare
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def prepare():
"""Prepare Oslo Logging (2 or 3 steps)
Use of Oslo Logging involves the following:
* logging.register_options
* logging.set_defaults (optional)
* logging.setup
"""
# Required step to register common, logging and generic configuration
# variables
logging.register_options(CONF)
# Optional step to set new defaults if necessary for
# * logging_context_format_string
# * default_log_levels
#
# These variables default to respectively:
#
# import oslo_log
# oslo_log._options.DEFAULT_LOG_LEVELS
# oslo_log._options.log_opts[0].default
#
extra_log_level_defaults = [
'dogpile=INFO',
'routes=INFO'
]
logging.set_defaults(
default_log_levels=logging.get_default_log_levels() +
extra_log_level_defaults)
# Required setup based on configuration and domain
logging.setup(CONF, DOMAIN)
示例9: parse_args
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def parse_args(argv):
"""Sets up configuration of monasca-notification."""
global _CONF_LOADED
if _CONF_LOADED:
LOG.debug('Configuration has been already loaded')
return
conf.register_opts(CONF)
log.register_options(CONF)
default_log_levels = (log.get_default_log_levels())
log.set_defaults(default_log_levels=default_log_levels)
CONF(args=argv,
project='monasca',
prog=sys.argv[1:],
version=version.version_string,
default_config_files=_get_config_files(),
description='''
monasca-notification is an engine responsible for
transforming alarm transitions into proper notifications
''')
conf.register_enabled_plugin_opts(CONF)
log.setup(CONF,
product_name='monasca-notification',
version=version.version_string)
_CONF_LOADED = True
示例10: parse_args
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def parse_args(args=None, usage=None, default_config_files=None):
CLI_OPTS = [launch_opt]
CONF.register_cli_opts(CLI_OPTS)
for group, options in list_opts():
CONF.register_opts(list(options), group)
_DEFAULT_LOG_LEVELS = [
'eventlet.wsgi.server=WARN',
'oslo_service.periodic_task=INFO',
'oslo_service.loopingcall=INFO',
'oslo_db=WARN',
'oslo_concurrency.lockutils=WARN',
'kubernetes.client.rest=%s' % CONF.kubernetes.log_devel,
'keystoneclient=INFO',
'requests.packages.urllib3.connectionpool=CRITICAL',
'urllib3.connectionpool=CRITICAL',
'cotyledon=INFO',
'futurist.periodics=WARN'
]
default_log_levels = log.get_default_log_levels()
default_log_levels.extend(_DEFAULT_LOG_LEVELS)
log.set_defaults(default_log_levels=default_log_levels)
log.register_options(CONF)
CONF(
args=args,
project='qinling',
version=version,
usage=usage,
default_config_files=default_config_files
)
示例11: prepare
# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import get_default_log_levels [as 别名]
def prepare():
"""Prepare Oslo Logging (2 or 3 steps)
Use of Oslo Logging involves the following:
* logging.register_options
* logging.set_defaults (optional)
* logging.setup
"""
LOG.debug("Prepare Oslo Logging")
LOG.info("Size of configuration options before %d", len(CONF))
# Required step to register common, logging and generic configuration
# variables
logging.register_options(CONF)
LOG.info("Size of configuration options after %d", len(CONF))
# Optional step to set new defaults if necessary for
# * logging_context_format_string
# * default_log_levels
#
# These variables default to respectively:
#
# import oslo_log
# oslo_log._options.DEFAULT_LOG_LEVELS
# oslo_log._options.log_opts[0].default
#
custom_log_level_defaults = logging.get_default_log_levels() + [
'dogpile=INFO',
'routes=INFO'
]
logging.set_defaults(default_log_levels=custom_log_level_defaults)
# NOTE: We cannot show the contents of the CONF object
# after register_options() because accessing this caches
# the default_log_levels subsequently modified with set_defaults()
LOG.info("List of Oslo Logging configuration options and current values")
LOG.info("=" * 80)
for c in CONF:
LOG.info("%s = %s" % (c, CONF[c]))
LOG.info("=" * 80)
# Required setup based on configuration and domain
logging.setup(CONF, DOMAIN)