While debugging, it quickly became clear that the thread ID was much more useful than the process ID. This may, or may not, be a personal preference. On the chance that this is a useful change, here's a patch that may help reduce the work to perform the conversion. This patch is against 1.0.7-i.
1.0.7-i patch: change %P to %T in trace logging