mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-11 16:13:11 +00:00
print thread name on trace
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3206 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
0bb2970222
commit
c6b5759c39
1 changed files with 6 additions and 6 deletions
|
|
@ -18,10 +18,8 @@ import re
|
|||
import linecache
|
||||
import time
|
||||
import sys
|
||||
try:
|
||||
import thread as _thread
|
||||
except ImportError:
|
||||
import dummy_thread as _thread
|
||||
import thread
|
||||
import threading
|
||||
|
||||
# tracing
|
||||
_trace_ignore = set()
|
||||
|
|
@ -88,8 +86,10 @@ def _trace_line (frame, event, arg):
|
|||
if filename.endswith(".pyc") or filename.endswith(".pyo"):
|
||||
filename = filename[:-1]
|
||||
line = linecache.getline(filename, lineno)
|
||||
print "THREAD(%d) %.2f %s # %s:%d" % \
|
||||
(_thread.get_ident(), time.time(), line.rstrip(), name, lineno)
|
||||
tid = thread.get_ident()
|
||||
tname = threading.currentThread().getName()
|
||||
args = (tid, tname, time.time(), line.rstrip(), name, lineno)
|
||||
print "THREAD(%d) %r %.2f %s # %s:%d" % args
|
||||
|
||||
|
||||
def trace_on (full=False):
|
||||
|
|
|
|||
Loading…
Reference in a new issue