Skip to content

Instantly share code, notes, and snippets.

@tonywangcn
Created April 24, 2017 13:48
Show Gist options
  • Save tonywangcn/7c8169c2990d674f3f49250fb68f6a5c to your computer and use it in GitHub Desktop.
Save tonywangcn/7c8169c2990d674f3f49250fb68f6a5c to your computer and use it in GitHub Desktop.
multithread demo log
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