当前位置: 首页>>代码示例>>Python>>正文


Python log.get_default_log_levels方法代码示例

本文整理汇总了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) 
开发者ID:openstack,项目名称:masakari,代码行数:21,代码来源:config.py

示例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}) 
开发者ID:openstack,项目名称:kuryr-kubernetes,代码行数:10,代码来源:config.py

示例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)) 
开发者ID:openstack,项目名称:octavia,代码行数:16,代码来源:config.py

示例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, ) 
开发者ID:airshipit,项目名称:armada,代码行数:15,代码来源:__init__.py

示例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) 
开发者ID:att-comdev,项目名称:armada,代码行数:17,代码来源:__init__.py

示例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 
开发者ID:ntt-sic,项目名称:masakari,代码行数:13,代码来源:masakari_config.py

示例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()) 
开发者ID:openstack,项目名称:oslo.log,代码行数:5,代码来源:test_log.py

示例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) 
开发者ID:openstack,项目名称:oslo.log,代码行数:38,代码来源:usage_context.py

示例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 
开发者ID:openstack,项目名称:monasca-notification,代码行数:33,代码来源:config.py

示例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
    ) 
开发者ID:openstack,项目名称:qinling,代码行数:34,代码来源:config.py

示例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) 
开发者ID:openstack,项目名称:oslo.log,代码行数:51,代码来源:usage_helper.py


注:本文中的oslo_log.log.get_default_log_levels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。