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


Python log.getLogger函数代码示例

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


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

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

示例2: retry

from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import models
from six import moves
from sqlalchemy import exc as sqla_exc
from sqlalchemy.ext import declarative
from sqlalchemy.orm import exc as orm_exc
from sqlalchemy import types

from solum.common import exception
from solum.common import yamlutils
from solum import objects
from solum.objects import sqlalchemy as object_sqla
from solum.openstack.common import log as logging
from solum.openstack.common import uuidutils

LOG = logging.getLogger(__name__)


def retry(fun):
    """Decorator to retry a DB call if certain exception was received."""
    @functools.wraps(fun)
    def _wrapper(*args, **kwargs):
        max_retries = kwargs.pop('max_retries', 3)
        for tries in range(max_retries):
            try:
                return fun(*args, **kwargs)
            except (db_exc.DBDeadlock, orm_exc.StaleDataError,
                    exception.ResourceExists):
                LOG.warning("Failed DB call %s. Retrying %s more times." %
                            (fun.__name__, max_retries - tries - 1))
                if tries + 1 >= max_retries:
开发者ID:aneeshep,项目名称:solum,代码行数:31,代码来源:models.py

示例3:

import docker
from docker import errors
from oslo_config import cfg
from requests.packages.urllib3 import exceptions as req_exp

from solum.common import exception as exc
from solum.common import solum_swiftclient
from solum.openstack.common import log as solum_log
from solum.uploaders import tenant_logger
from solum.worker.lp_handlers import utils

from swiftclient import exceptions as swiftexp


LOG = solum_log.getLogger(__name__)

cfg.CONF.import_opt('task_log_dir', 'solum.worker.config', group='worker')
cfg.CONF.import_opt('docker_daemon_url', 'solum.worker.config', group='worker')
cfg.CONF.import_opt('docker_build_timeout', 'solum.worker.config',
                    group='worker')
cfg.CONF.import_opt('container_mem_limit', 'solum.worker.config',
                    group='worker')
log_dir = cfg.CONF.worker.task_log_dir
docker_daemon_url = cfg.CONF.worker.docker_daemon_url
build_timeout = cfg.CONF.worker.docker_build_timeout
mem_limit = cfg.CONF.worker.container_mem_limit

MAX_GIT_CLONE_RETRY = 5
GIT_CLONE_TIMEOUT = 900  # 15 minutes
cloner_gid = os.getgid()
开发者ID:prayalankar2,项目名称:solum,代码行数:30,代码来源:base.py

示例4: TenantLogger

#    limitations under the License.

import datetime as dt
import json
import logging
import time

from oslo.config import cfg

from solum.openstack.common import log as openstack_logger
import solum.uploaders.local as local_uploader
import solum.uploaders.swift as swift_uploader

cfg.CONF.import_group('worker', 'solum.worker.handlers.shell')

LOG = openstack_logger.getLogger(__name__)


class TenantLogger(object):

    def __init__(self, ctxt, assem, deployer_log_dir, stage):
        strategy = cfg.CONF.worker.log_upload_strategy
        LOG.debug("User log upload strategy: %s" % strategy)

        self.ctxt = ctxt
        self.assem = assem
        self.stage = stage

        # Note: assembly type is used by uploader
        self.assem.type = 'app'
开发者ID:modulexcite,项目名称:solum,代码行数:30,代码来源:tenant_logger.py

示例5: ObjectException

import collections
import copy
import functools

import six

from solum.objects import fields
from solum.openstack.common.gettextutils import _
from solum.openstack.common import log as logging
from solum.openstack.common.rpc import common as rpc_common
import solum.openstack.common.rpc.serializer
from solum.openstack.common import versionutils


LOG = logging.getLogger('object')


class NotSpecifiedSentinel:
    pass


class ObjectException(Exception):
    """Base Object Exception."""


class UnsupportedObjectError(ObjectException):
    def __init__(self, **kwargs):
        super(ObjectException, self).__init__(
            _('Unsupported object type %(objtype)s') % kwargs
            )
开发者ID:smarterclayton,项目名称:solum,代码行数:30,代码来源:base.py


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