• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python log.getLogger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python script.MoinScript类代码示例发布时间:2022-05-24
下一篇:
Python items.Item类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap