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


Python PLOG.enableFilelog方法代码示例

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


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

示例1: init

# 需要导入模块: from pysmartac.log import PLOG [as 别名]
# 或者: from pysmartac.log.PLOG import enableFilelog [as 别名]
def init():    
    configfile=assistant.SF("%s/radiusCheck.conf"%(os.path.dirname(__file__)))
    print os.path.dirname(__file__)
    config=pysmartac.configer.openconfiger(configfile)

    #configer
    conf.logLevel=config.getstr("system","logLevel",conf.logLevel)
    conf.clientPath=config.getstr("system","clientPath",conf.clientPath)
    conf.logDir=config.getstr("system","logDir",conf.logDir)
    conf.radiusIP=config.getstr("system","radiusIP",conf.radiusIP)
    conf.reponseTimeout=config.getint("system","reponseTimeout",conf.reponseTimeout)
    conf.secret=config.getstr("system","secret",conf.secret)
    config.save()
    #log settings
    PLOG.setlevel(conf.logLevel)
    PLOG.enableFilelog("%s/log/RADCK_$(Date8).log"%(os.path.dirname(__file__)))
开发者ID:zhangqiaoli,项目名称:pythonTool,代码行数:18,代码来源:radiusCheck.py

示例2: init

# 需要导入模块: from pysmartac.log import PLOG [as 别名]
# 或者: from pysmartac.log.PLOG import enableFilelog [as 别名]
def init():    
    configfile=assistant.SF("%s/filecrawler.conf"%(os.path.dirname(__file__)))
    print os.path.dirname(__file__)
    config=pysmartac.configer.openconfiger(configfile)

    #configer
    conf.logLevel=config.getstr("system","logLevel",conf.logLevel)
    conf.httpServerSite=config.getstr("system","httpserversite",conf.httpServerSite)
    conf.movieDir=config.getstr("system","movieDir",conf.movieDir)
    conf.iosDir=config.getstr("system","iosDir",conf.iosDir)
    conf.androidDir=config.getstr("system","androidDir",conf.androidDir)
    conf.movieOutputFile=config.getstr("system","movieOutputFile",conf.movieOutputFile)
    conf.iosOutputFile=config.getstr("system","iosOutputFile",conf.iosOutputFile) 
    conf.androidOutputFile=config.getstr("system","androidOutputFile",conf.androidOutputFile) 
    config.save()
    #log settings
    PLOG.setlevel(conf.logLevel)
    PLOG.enableFilelog("%s/log/FLCRAWLER_$(Date8)_$(filenumber2).log"%(os.path.dirname(__file__)))
开发者ID:zhangqiaoli,项目名称:pythonTool,代码行数:20,代码来源:filecrawler.py

示例3: init

# 需要导入模块: from pysmartac.log import PLOG [as 别名]
# 或者: from pysmartac.log.PLOG import enableFilelog [as 别名]
def init():    
    configfile=assistant.SF("%s/filecrawler.conf"%(os.path.dirname(__file__)))
    print os.path.dirname(__file__)
    config=pysmartac.configer.openconfiger(configfile)

    #configer
    conf.pidfile=config.getstr("system","pidfile",conf.pidfile)
    conf.threadCount=config.getint("system","threadCount",conf.threadCount)
    conf.logLevel=config.getstr("system","logLevel",conf.logLevel)
    conf.httpServerSite=config.getstr("system","httpserversite",conf.httpServerSite)
    conf.movieDir=config.getstr("system","movieDir",conf.movieDir)
    conf.appDir=config.getstr("system","appDir",conf.appDir)
    conf.movieOutputFile=config.getstr("system","movieOutputFile",conf.movieOutputFile)
    conf.appOutputFile=config.getstr("system","appOutputFile",conf.appOutputFile)    
    conf.checkInterval=config.getint("system","checkInterval",conf.checkInterval)
    config.save()
    #log settings
    PLOG.setlevel(conf.logLevel)
    PLOG.enableFilelog("%s/log/FLCRAWLER_$(Date8)_$(filenumber2).log"%(os.path.dirname(__file__)))
开发者ID:zhangqiaoli,项目名称:pythonTool,代码行数:21,代码来源:filecrawlerUTF8统一编码版.py

示例4: init

# 需要导入模块: from pysmartac.log import PLOG [as 别名]
# 或者: from pysmartac.log.PLOG import enableFilelog [as 别名]
def init():
    configfile = assistant.SF("%s/filecrawler.conf" % (os.path.dirname(__file__)))
    print os.path.dirname(__file__)
    config = pysmartac.configer.openconfiger(configfile)

    # configer
    conf.pidfile = config.getstr("system", "pidfile", conf.pidfile)
    conf.threadCount = config.getint("system", "threadCount", conf.threadCount)
    conf.logLevel = config.getstr("system", "logLevel", conf.logLevel)
    conf.ftpServerMovieSource = config.getstr("system", "ftpServerMovieSource", conf.ftpServerMovieSource)
    conf.ftpServerAppSource = config.getstr("system", "ftpServerAppSource", conf.ftpServerAppSource)
    conf.ftpServerUser = config.getstr("system", "ftpServerUser", conf.ftpServerUser)
    conf.ftpServerPwd = config.getstr("system", "ftpServerPwd", conf.ftpServerPwd)
    conf.ftpJsonOutputPath = config.getstr("system", "ftpJsonOutputPath", conf.ftpJsonOutputPath)
    conf.movieOutputFile = config.getstr("system", "movieOutputFile", conf.movieOutputFile)
    conf.appOutputFile = config.getstr("system", "appOutputFile", conf.appOutputFile)
    conf.checkInterval = config.getint("system", "checkInterval", conf.checkInterval)
    config.save()
    # log settings
    PLOG.setlevel(conf.logLevel)
    PLOG.enableFilelog(assistant.SF("%s/log/FLCRAWLER_$(Date8)_$(filenumber2).log" % (os.path.dirname(__file__))))
开发者ID:zhangqiaoli,项目名称:pythonTool,代码行数:23,代码来源:filecrawler+-+MLSD.py

示例5: CF

# 需要导入模块: from pysmartac.log import PLOG [as 别名]
# 或者: from pysmartac.log.PLOG import enableFilelog [as 别名]
            for p in self.programlist:
                items.append((p.name, p.status))
            fmt = '%-40s %9s'
            ret = '\n'.join([fmt % (x, '[%s]' % y) for x, y in items])
            PLOG.info("report runing status:\n%s" % ret)
        elif msg == "stop":
            pass
        return ret
class CF:
    pass
if __name__ == "__main__":
    conf = CF()
    conf.host = "127.0.0.1"
    conf.port = 24001
    PLOG.trace(assistant.SF("%s/log/ALS_$(Date8)_$(filenumber2).log" % (os.path.dirname(__file__))))
    PLOG.enableFilelog("%s/log/ALS_$(Date8)_$(filenumber2).log" % (os.path.dirname(__file__)))
    try:
        parentpid = os.getppid()
    except:
        print "no parent id!"
        sys.exit(1)
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    try:
        s.bind((conf.host, conf.port))
        s.settimeout(1)
    except Exception, e:
        print("绑定UDP端口失败,Host=%s,Port=%d,err=%s" % (conf.host, conf.port, e))
        sys.exit(1)
    print ("Start listen UDP[%s:%d]..." % (conf.host, conf.port))
    print "alwayson dog starting..."
开发者ID:zhangqiaoli,项目名称:pythonTool,代码行数:33,代码来源:alwayson_dog.py


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