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


Python log.set_defaults方法代码示例

本文整理汇总了Python中oslo_log.log.set_defaults方法的典型用法代码示例。如果您正苦于以下问题:Python log.set_defaults方法的具体用法?Python log.set_defaults怎么用?Python log.set_defaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oslo_log.log的用法示例。


在下文中一共展示了log.set_defaults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_args

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [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: main

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def main():
    config.parse_args(sys.argv, 'senlin-conductor')
    logging.setup(CONF, 'senlin-conductor')
    logging.set_defaults()
    gmr.TextGuruMeditation.setup_autorun(version)
    objects.register_all()
    messaging.setup()

    from senlin.conductor import service as conductor

    profiler.setup('senlin-conductor', CONF.host)
    srv = conductor.ConductorService(CONF.host, consts.CONDUCTOR_TOPIC)
    launcher = service.launch(CONF, srv,
                              workers=CONF.conductor.workers,
                              restart_method='mutate')
    # the following periodic tasks are intended serve as HA checking
    # srv.create_periodic_tasks()
    launcher.wait() 
开发者ID:openstack,项目名称:senlin,代码行数:20,代码来源:conductor.py

示例3: main

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def main():
    config.parse_args(sys.argv, 'senlin-engine')
    logging.setup(CONF, 'senlin-engine')
    logging.set_defaults()
    gmr.TextGuruMeditation.setup_autorun(version)
    objects.register_all()
    messaging.setup()

    from senlin.engine import service as engine

    profiler.setup('senlin-engine', CONF.host)
    srv = engine.EngineService(CONF.host,
                               consts.ENGINE_TOPIC)
    launcher = service.launch(CONF, srv,
                              workers=CONF.engine.workers,
                              restart_method='mutate')
    launcher.wait() 
开发者ID:openstack,项目名称:senlin,代码行数:19,代码来源:engine.py

示例4: main

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def main():
    config.parse_args(sys.argv, 'senlin-health-manager')
    logging.setup(CONF, 'senlin-health-manager')
    logging.set_defaults()
    gmr.TextGuruMeditation.setup_autorun(version)
    objects.register_all()
    messaging.setup()

    from senlin.health_manager import service as health_manager

    profiler.setup('senlin-health-manager', CONF.host)
    srv = health_manager.HealthManagerService(CONF.host,
                                              consts.HEALTH_MANAGER_TOPIC)
    launcher = service.launch(CONF, srv,
                              workers=CONF.health_manager.workers,
                              restart_method='mutate')
    launcher.wait() 
开发者ID:openstack,项目名称:senlin,代码行数:19,代码来源:health_manager.py

示例5: set_cors_middleware_defaults

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def set_cors_middleware_defaults():
    """Update default configuration options for oslo.middleware."""
    cors.set_defaults(
        allow_headers=['X-Auth-Token',
                       'X-Identity-Status',
                       'X-Roles',
                       'X-Service-Catalog',
                       'X-User-Id',
                       'X-Tenant-Id',
                       'X-Project-Id',
                       'X-User-Name',
                       'X-Project-Name'],
        allow_methods=['GET',
                       'PUT',
                       'POST',
                       'DELETE',
                       'PATCH'],
        expose_headers=['X-Auth-Token',
                        'X-Subject-Token',
                        'X-Service-Token',
                        'X-Project-Id',
                        'X-User-Name',
                        'X-Project-Name']
    ) 
开发者ID:openstack,项目名称:qinling,代码行数:26,代码来源:config.py

示例6: parse_args

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def parse_args(argv, default_config_files=None):
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.register_options(CONF)
    options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION)

    cfg.CONF(argv[1:],
             project='ec2api',
             version=version.version_info.version_string(),
             default_config_files=default_config_files) 
开发者ID:openstack,项目名称:ec2-api,代码行数:11,代码来源:config.py

示例7: setup_logging

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [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

示例8: enable_logging

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def enable_logging(conf=None, app_name='castellan'):
    conf = conf or cfg.CONF

    log.register_options(conf)
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT,
                     _DEFAULT_LOG_LEVELS)

    log.setup(conf, app_name) 
开发者ID:openstack,项目名称:castellan,代码行数:10,代码来源:options.py

示例9: add_command_parsers

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def add_command_parsers(subparsers):
    for name in ['current', 'history', 'branches']:
        parser = add_alembic_subparser(subparsers, name)
        parser.set_defaults(func=do_alembic_command)

    help_text = (getattr(alembic_cmd, 'branches').__doc__ +
                 ' and validate head file')
    parser = subparsers.add_parser('check_migration', help=help_text)
    parser.set_defaults(func=do_check_migration)

    parser = add_alembic_subparser(subparsers, 'upgrade')
    parser.add_argument('--delta', type=int)
    parser.add_argument('--sql', action='store_true')
    parser.add_argument('revision', nargs='?')
    parser.set_defaults(func=do_upgrade)

    parser = subparsers.add_parser(
        "upgrade_persistence",
        help="Run migrations for persistence backend")
    parser.set_defaults(func=do_persistence_upgrade)

    parser = subparsers.add_parser('downgrade', help="(No longer supported)")
    parser.add_argument('None', nargs='?', help="Downgrade not supported")
    parser.set_defaults(func=no_downgrade)

    parser = add_alembic_subparser(subparsers, 'stamp')
    parser.add_argument('--sql', action='store_true')
    parser.add_argument('revision')
    parser.set_defaults(func=do_stamp)

    parser = add_alembic_subparser(subparsers, 'revision')
    parser.add_argument('-m', '--message')
    parser.add_argument('--autogenerate', action='store_true')
    parser.add_argument('--sql', action='store_true')
    parser.set_defaults(func=do_revision) 
开发者ID:openstack,项目名称:octavia,代码行数:37,代码来源:cli.py

示例10: setup_logging

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [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

示例11: setup_logging

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def setup_logging():
    _DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN',
                           'stevedore=WARN', 'oslo_log=INFO',
                           'iso8601=WARN', 'elasticsearch=WARN',
                           'requests.packages.urllib3.connectionpool=WARN',
                           'urllib3.connectionpool=WARN', 'websocket=WARN',
                           'keystonemiddleware=WARN', 'routes.middleware=WARN']
    _DEFAULT_LOGGING_CONTEXT_FORMAT = ('%(asctime)s.%(msecs)03d %(process)d '
                                       '%(levelname)s %(name)s [%(request_id)s'
                                       ' %(user_identity)s] %(instance)s '
                                       '%(message)s')
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.setup(CONF, 'freezer-api', version=FREEZER_API_VERSION) 
开发者ID:openstack,项目名称:freezer-api,代码行数:15,代码来源:config.py

示例12: __init__

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def __init__(self):
        self.logger = LOG
        logging.set_defaults(default_log_levels=CONF.default_log_levels)
        logging.setup(CONF, 'armada') 
开发者ID:airshipit,项目名称:armada,代码行数:6,代码来源:__init__.py

示例13: set_default_for_default_log_levels

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [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

示例14: create

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def create(enable_middleware=CONF.middleware):
    """Entry point for initializing Armada server.

    :param enable_middleware: Whether to enable middleware.
    :type enable_middleware: bool
    """

    if enable_middleware:
        api = falcon.API(
            request_type=ArmadaRequest,
            middleware=[
                AuthMiddleware(),
                ContextMiddleware(),
                LoggingMiddleware(),
            ])
    else:
        api = falcon.API(request_type=ArmadaRequest)

    logging.set_defaults(default_log_levels=CONF.default_log_levels)
    logging.setup(CONF, 'armada')

    # Configure API routing
    url_routes_v1 = (
        ('health', Health()),
        ('apply', Apply()),
        ('releases', Release()),
        ('status', Status()),
        ('tests', TestReleasesManifestController()),
        ('test/{release}', TestReleasesReleaseNameController()),
        ('validatedesign', Validate()),
    )

    for route, service in url_routes_v1:
        api.add_route("/api/v1.0/{}".format(route), service)
    api.add_route('/versions', Versions())

    # Initialize policy config options.
    policy.Enforcer(CONF)

    return api 
开发者ID:att-comdev,项目名称:armada,代码行数:42,代码来源:server.py

示例15: __init__

# 需要导入模块: from oslo_log import log [as 别名]
# 或者: from oslo_log.log import set_defaults [as 别名]
def __init__(self):
        self.logger = LOG
        logging.register_options(CONF)
        logging.set_defaults(default_log_levels=CONF.default_log_levels)
        logging.setup(CONF, 'armada') 
开发者ID:att-comdev,项目名称:armada,代码行数:7,代码来源:__init__.py


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