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


Python log.getLogger函数代码示例

本文整理汇总了Python中tuskar.openstack.common.log.getLogger函数的典型用法代码示例。如果您正苦于以下问题:Python getLogger函数的具体用法?Python getLogger怎么用?Python getLogger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: main

def main():
    # Parse config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)
    # make sure we have tripleo-heat-templates:
    heat_template_path = CONF.tht_local_dir
    try:
        os.listdir(heat_template_path)
    except OSError:
        LOG.info(
            "Can't find local tripleo-heat-template files at %s"
            % (heat_template_path))
        LOG.info(
            "Cannot proceed - missing tripleo heat templates "
            "See INSTALL documentation for more info")
        raise
    LOG.info("Using tripleo-heat-templates at %s" % (heat_template_path))

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
开发者ID:jsomara,项目名称:tuskar,代码行数:33,代码来源:api.py

示例2: notify

def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger(
        'tuskar.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
开发者ID:ccrouch,项目名称:tuskar,代码行数:11,代码来源:log_notifier.py

示例3: main

def main():
    # Pase config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
            host, port,
            app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
开发者ID:ccrouch,项目名称:tuskar,代码行数:20,代码来源:api.py

示例4: main

def main(argv=None):

    if argv is None:
        argv = sys.argv

    tuskar_service.prepare_service(argv)

    # Build and start the WSGI app
    host = cfg.CONF.tuskar_api_bind_ip
    port = cfg.CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    cfg.CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
开发者ID:jdob,项目名称:tuskar,代码行数:23,代码来源:api.py

示例5: HeatClient

               help='The tenant name the overcloud is deployed on behalf of'
               ),
    cfg.StrOpt('auth_url',
               default=env.get('OS_AUTH_URL') or 'http://localhost:35357/v2.0',
               help='Keystone authentication URL'
               ),
    cfg.BoolOpt('insecure',
                default=True,
                help='Set to False when Heat API uses HTTPS'
                )
]

CONF = cfg.CONF
CONF.register_opts(heat_opts, group='heat')
CONF.register_opts(heat_keystone_opts, group='heat_keystone')
LOG = logging.getLogger(__name__)

from heatclient.exc import HTTPNotFound as HeatStackNotFound
from heatclient.v1.client import Client as heatclient
from keystoneclient.v2_0 import client as ksclient


class HeatClient(object):
    """Heat CloudFormations API client to use in Tuskar"""

    def __init__(self):
        try:
            keystone = ksclient.Client(**CONF.heat_keystone)
            endpoint = keystone.service_catalog.url_for(
                service_type=CONF.heat['service_type'],
                endpoint_type=CONF.heat['endpoint_type']
开发者ID:redhat-openstack,项目名称:tuskar,代码行数:31,代码来源:client.py


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