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


Python log.getLogger函数代码示例

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


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

示例1: _run

 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket,
                          application,
                          custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))
开发者ID:clefelhocz,项目名称:qonos,代码行数:7,代码来源:wsgi.py

示例2: run

    def run(self, run_once=False):
        LOG.debug(_('Starting qonos-api service'))
        # This must be done after the 'well-known' config options are loaded
        # so the list of action_overrides can be read
        self.register_action_override_cfg_opts()
        wsgi_logger = logging.getLogger('eventlet.wsgi.server')

        wsgi.run_server(self.app, CONF.api.port,
                        log=logging.WritableLogger(wsgi_logger),
                        log_format=CONF.api.wsgi_log_format)
开发者ID:rackerlabs,项目名称:qonos,代码行数:10,代码来源:api.py

示例3: 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(
        'qonos.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
开发者ID:isethi,项目名称:qonos,代码行数:11,代码来源:log_notifier.py

示例4: run

    def run(self, run_once=False):
        LOG.debug(_('Starting qonos-api service'))
        # This must be done after the 'well-known' config options are loaded
        # so the list of action_overrides can be read
        self.register_action_override_cfg_opts()
        wsgi_logger = logging.getLogger('eventlet.wsgi.server')

        if CONF.api.daemonized:
            import daemon
            #NOTE(ameade): We need to preserve all open files for logging
            open_files = utils.get_qonos_open_file_log_handlers()
            with daemon.DaemonContext(files_preserve=open_files):
                wsgi.run_server(self.app, CONF.api.port,
                                log=logging.WritableLogger(wsgi_logger),
                                log_format=CONF.api.wsgi_log_format)
        else:
            wsgi.run_server(self.app, CONF.api.port,
                            log=logging.WritableLogger(wsgi_logger),
                            log_format=CONF.api.wsgi_log_format)
开发者ID:clefelhocz,项目名称:qonos,代码行数:19,代码来源:api.py

示例5: force_dict

from qonos.common import exception
import qonos.db.db_utils as db_utils
from qonos.db.sqlalchemy import models
from qonos.openstack.common import cfg
from qonos.openstack.common.gettextutils import _
import qonos.openstack.common.log as os_logging
from qonos.openstack.common import timeutils


_ENGINE = None
_MAKER = None
_MAX_RETRIES = None
_RETRY_INTERVAL = None
BASE = models.BASE
sa_logger = None
LOG = os_logging.getLogger(__name__)

db_opts = [
    cfg.IntOpt('sql_idle_timeout', default=3600),
    cfg.IntOpt('sql_max_retries', default=60),
    cfg.IntOpt('sql_retry_interval', default=1),
    cfg.BoolOpt('db_auto_create', default=True),
]

CONF = cfg.CONF
CONF.register_opts(db_opts)


def force_dict(func):
    """Ensure returned object is a dict or list of dicts."""
开发者ID:isethi,项目名称:qonos,代码行数:30,代码来源:api.py


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