spacemanspiff2007 · GitHub

Feature or enhancement

Proposal:

Currently faulthandler just dumps the thread id.
It would be nice if the thread name would also be part of the output since this makes debugging much easier

Current output

Thread 0x00003b9c (most recent call first):
  File "C:\ProgramFiles\Python\Python312\Lib\concurrent\futures\thread.py", line 89 in _worker
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1012 in run
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1075 in _bootstrap_inner
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1032 in _bootstrap
...

Better output with thread name in square brackets

Thread 0x00003b9c [Thread pool worker 1] (most recent call first):
  File "C:\ProgramFiles\Python\Python312\Lib\concurrent\futures\thread.py", line 89 in _worker
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1012 in run
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1075 in _bootstrap_inner
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1032 in _bootstrap
...

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Read the original on github.com ↗