Show human-readable thread ID in log messages.

This helps debug some multithreading issues.
This commit is contained in:
Jordan Bancino 2023-05-27 17:10:07 +00:00
parent 5694a609eb
commit c5cfdb9894
4 changed files with 46 additions and 3 deletions

View file

@ -24,6 +24,7 @@
#include <Log.h>
#include <Memory.h>
#include <Util.h>
#include <string.h>
#include <time.h>
@ -316,6 +317,8 @@ Logv(LogConfig * config, int level, const char *msg, va_list argp)
}
}
StreamPrintf(config->out, "(%lu) ", UtilThreadNo());
switch (level)
{
case LOG_EMERG: