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


Python log.getLogger函数代码示例

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


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

示例1: load_package_modules

def load_package_modules(package_name, package_pathes):
    """
    Load (import) all modules from some package (except those starting with _).

    This is useful if there is some code in the module that runs at import time
    and registers some code of that module somewhere.

    Call this from __init__.py of the same package like this:

        load_package_modules(__name__, __path__)
    """
    for path in package_pathes:
        for root, dirs, files in os.walk(path):
            del dirs[:]
            for fname in files:
                if fname.startswith('_') or not fname.endswith('.py'):
                    continue
                module = fname[:-3]
                module_complete = package_name + '.' + module
                if module_complete in sys.modules:
                    continue
                info = imp.find_module(module, [root])
                try:
                    try:
                        imp.load_module(module_complete, *info)
                    except Exception as e:
                        import MoinMoin.log as logging
                        logger = logging.getLogger(package_name)
                        logger.exception("Failed to import {0} package module {1}: {2}".format(package_name, module, e))
                finally:
                    info[0].close()
开发者ID:pombredanne,项目名称:moin2,代码行数:31,代码来源:pysupport.py

示例2: get_names

from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT

from MoinMoin import user
from MoinMoin.search.analyzers import item_name_analyzer, MimeTokenizer, AclTokenizer
from MoinMoin.themes import utctimestamp
from MoinMoin.storage.middleware.validation import ContentMetaSchema, UserMetaSchema, validate_data
from MoinMoin.storage.error import NoSuchItemError, ItemAlreadyExistsError
from MoinMoin.util.interwiki import split_fqname, CompositeName

from MoinMoin.util.mime import Type, type_moin_document
from MoinMoin.util.tree import moin_page
from MoinMoin.converter import default_registry
from MoinMoin.util.iri import Iri

from MoinMoin import log
logging = log.getLogger(__name__)


WHOOSH_FILESTORAGE = 'FileStorage'
INDEXES = [LATEST_REVS, ALL_REVS, ]

VALIDATION_HANDLING_STRICT = 'strict'
VALIDATION_HANDLING_WARN = 'warn'
VALIDATION_HANDLING = VALIDATION_HANDLING_WARN


def get_names(meta):
    """
    Get the (list of) names from meta data and deal with misc. bad things that
    can happen then (while not all code is fixed to do it correctly).
开发者ID:denedios,项目名称:moin-2.0,代码行数:30,代码来源:indexing.py

示例3: RequestHandler

# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - This module contains additional code related to serving
               requests with the standalone server. It uses werkzeug's
               BaseRequestHandler and overrides some functions that
               need to be handled different in MoinMoin than in werkzeug

    @copyright: 2008-2008 MoinMoin:FlorianKrupicka
    @license: GNU GPL, see COPYING for details.
"""
import os
from MoinMoin import config

from MoinMoin import version, log
logging = log.getLogger(__name__)

# make werkzeug use our logging framework and configuration:
import werkzeug._internal
werkzeug._internal._logger = log.getLogger('werkzeug')

from werkzeug import run_simple
from werkzeug.serving import BaseRequestHandler

class RequestHandler(BaseRequestHandler):
    """
    A request-handler for WSGI, that overrides the default logging
    mechanisms to log via MoinMoin's logging framework.
    """
    server_version = "MoinMoin %s %s" % (version.release,
                                         version.revision)
开发者ID:Glottotopia,项目名称:aagd,代码行数:30,代码来源:serving.py

示例4: __init__

"""

__version__ = '0.0.4.2'

import urllib2
import re
import os

from MoinMoin import log
from MoinMoin.Page import Page
from MoinMoin.PageEditor import PageEditor
from MoinMoin.action import AttachFile
from MoinMoin import wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser

logger = log.getLogger(__name__)

class Image2Attach:

    def __init__(self, pagename, request):
        self.pagename = pagename
        self.request = request
        self.page = Page(request, pagename)
        self.image_urls = []
        self.images = {} # image binay files {filename: content}
        self.images_fetched = [] # images successful fetched
        self.process_success = 0 # count of process successful
        self.process_fail = 0 # count of process failed
        self.text = ''
        self.image_extenstions = ['jpg', 'gif', 'png']
开发者ID:alswl,项目名称:image2attach,代码行数:30,代码来源:Image2Attach.py


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