Created
April 24, 2017 13:48
-
-
Save tonywangcn/7c8169c2990d674f3f49250fb68f6a5c to your computer and use it in GitHub Desktop.
multithread demo log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import logger | |
logger = logger.handler_configure(clientip='your ip', user='logging_test') | |
class ThreadUrl(threading.Thread): | |
def run(self): | |
logger.info("Hey log it's a debug") | |
try: | |
open('testfile') | |
except Exception as e: | |
logger.error("Hey log it's an error {0}".format(e)) | |
for i in range(10): | |
t = ThreadUrl() | |
t.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment