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


Python Logging.getLogger方法代码示例

本文整理汇总了Python中Logging.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Python Logging.getLogger方法的具体用法?Python Logging.getLogger怎么用?Python Logging.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logging的用法示例。


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

示例1: __init__

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
    def __init__(self, master=None, config=None, logger=None, onQuit=None):
        self._config = config or {}
        self.onQuit = onQuit

        size = self._config.get("main", {}).get("size", (800, 600))
        Tkinter.Frame.__init__(self, master, width=int(size[0]), height=int(size[1]))
        self.pack()

        self.log = logger or Logging.getLogger(self.__class__.__name__)
        # self.log.debug(self._config)

        self.mpd = mpdlib.MPDClient()
        self._host = self._config["mpd"].get("host", "localhost")
        self._port = int(self._config["mpd"].get("port", "6600"))

        self._connect()
        self.wxListDataRef = []
        self.wxListDataModus = "play"

        self.createWidgets()
        self.widgets = {}

        self.updateWidgets()
        self.runUpdateSongProgress()

        try:
            self["cursor"] = "@nullCursor white"
        except Exception, e:
            self.log.warning("unable to set cursor: %s" % e)
开发者ID:native2k,项目名称:dockstarTouchIf,代码行数:31,代码来源:mpdshow.py

示例2: __init__

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
    def __init__(self, master=None, config=None, logger = None):
        Tkinter.Frame.__init__(self, master)
        self.pack()
        self.root = master
        
        self._config = config or {}
        self.log = logger or Logging.getLogger(self.__class__.__name__)
        if self.log.isEnabledFor('debug'):
            self.log.logBlock('debug', pformat(self._config))


        self.showImage()
开发者ID:native2k,项目名称:dockstarTouchIf,代码行数:14,代码来源:touchIF.py

示例3: __init__

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
    def __init__(self, root, config, onQuit = None, logger = None, statusFunc = None):
        self._config = config
        size = [int(e) for e in self._config['main'].get('size', SIZE)][:2]
        self.statusFunc = statusFunc
        
        Tkinter.Frame.__init__(self, root)
        self.log = logger or Logging.getLogger(self.__class__.__name__)
        self.updating = False

        self.old_image = None
        self.old_time = None
        self.old_date = None
        self.old_status = None
        
        self.dir = None
        self.dirlist = None

	self.root = root
        self.image = Tkinter.Canvas(self.root, width=size[0], height=size[0],  bg="black", bd=0)
        try:
            self.image['cursor'] ="@nullCursor white"
        except Exception, e:
            self.log.warning("unable to set cursor: %s" %  e)
开发者ID:native2k,项目名称:dockstarTouchIf,代码行数:25,代码来源:imageshow.py

示例4: Sync

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
#!/usr/bin/python
# _*_ coding:UTF-8 _*_
from ConfigParser import ConfigParser
import pymssql
import sys
import os.path
import Logging

logger = Logging.getLogger("Sync.py", "logs/Process.log")


class Sync(object):
    last

    def __init__(self, properties):
        logger.info("Class Sync init begin")
        cf = ConfigParser()
        logger.info("load config.properties")
        cf.read(properties)
        self.dbfromhost = cf.get("source", "db.from.host")
        self.dbfromname = cf.get("source", "db.from.name")
        self.dbfromuser = cf.get("source", "db.from.user")
        self.dbfrompassword = cf.get("source", "db.from.password")
        self.filebackuppath = cf.get("source", "file.backup.path")
        self.dbtohost = cf.get("target", "db.to.host")
        self.dbtoname = cf.get("target", "db.to.name")
        self.dbtouser = cf.get("target", "db.to.user")
        self.dbtopassword = cf.get("target", "db.to.password")
        self.filetopath = cf.get("target", "file.to.path")
        self.filebackupsuffix = cf.getint("param", "file.backup.suffix")
        self.filebackupmax = cf.getint("param", "file.backup.max")
开发者ID:FrankSang,项目名称:PyPro,代码行数:33,代码来源:Sync-bak.py

示例5: Sync

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
#!/usr/bin/python
#_*_ coding:UTF-8 _*_
from ConfigParser import ConfigParser
import pymssql
import sys
import os.path
import Logging

logger=Logging.getLogger('Sync.py','logs/Process.log')

class Sync(object):
    last=0
    def __init__(self,properties):
        logger.info('Class Sync init begin')
        cf=ConfigParser()
        logger.info('load config.properties')
        cf.read(properties)
        self.dbfromhost=cf.get('source','db.from.host')
        self.dbfromname=cf.get('source','db.from.name')
        self.dbfromuser=cf.get('source','db.from.user')
        self.dbfrompassword=cf.get('source','db.from.password')
        self.filebackuppath=cf.get('source','file.backup.path')
        self.dbtohost=cf.get('target','db.to.host')
        self.dbtoname=cf.get('target','db.to.name')
        self.dbtouser=cf.get('target','db.to.user')
        self.dbtopassword=cf.get('target','db.to.password')
        self.filetopath=cf.get('target','file.to.path')
        self.filebackupsuffix = cf.getint('param','file.backup.suffix')
        self.filebackupmax = cf.getint('param','file.backup.max')
        self.onlyFor = cf.get('param','onlyFor')
        self.filetocustom = cf.getboolean('param','file.to.custom')
开发者ID:FrankSang,项目名称:PyPro,代码行数:33,代码来源:Sync.py

示例6: button_click_exit_mainloop

# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import getLogger [as 别名]
import os, sys, itertools
import Tkinter
import Image, ImageTk, tkFont, tkMessageBox
from pprint import pformat
import traceback
import time
import random
import Logging

SIZE = 800, 600, 100, 100
WAIT = 1000*3
PATH = '.'
DIRECTORY = [path for path, dirs, files in os.walk(PATH) if '/.' not in path]

L = Logging.getLogger('ImageShow')

def button_click_exit_mainloop (event):
    event.widget.quit() # this will cause mainloop to unblock.

N = 12
def increment():
    global N
    N += 1
    return ' jjeayy N %s ' % N
   

class ShowImageApp(Tkinter.Frame):
    wgButton = None
    
    def __init__(self, root, config, onQuit = None, logger = None, statusFunc = None):
开发者ID:native2k,项目名称:dockstarTouchIf,代码行数:32,代码来源:imageshow.py


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