當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。