Ejemplo n.º 1
0
 def __init__(self, name):
     threading.Thread.__init__(self, name=name)
     self.log = App.logger(__name__)
Ejemplo n.º 2
0
#!/usr/bin/python
# coding:utf-8


from src.base.logger import ThreadProcess,process
from src import App

if __name__ == "__main__":
    log = App.logger(__name__)
    log.info("info")
    log.debug("debug")
    log.error("error")
    process.run()

    # 事实证明logging模块是多线程安全的
    for i in range(50):
        ThreadProcess.ThreadProcess("Thread" + str(i)).start()
Ejemplo n.º 3
0
def run():
    log = App.logger(__name__)
    log.info("process is running")