Print domain and task names in log prefix.
This commit is contained in:
parent
f307688bf4
commit
ff93e5e196
@ -145,13 +145,22 @@ rust_log::trace_ln(rust_task *task, char *message) {
|
|||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__)
|
||||||
uint32_t thread_id = 0;
|
uint32_t thread_id = 0;
|
||||||
#else
|
#else
|
||||||
uint32_t thread_id = (uint32_t) pthread_self();
|
uint32_t thread_id = hash((uint32_t) pthread_self());
|
||||||
#endif
|
#endif
|
||||||
char prefix[1024] = "";
|
char prefix[1024] = "";
|
||||||
append_string(prefix, "0x%08" PRIxPTR ":0x%08" PRIxPTR ":",
|
if (_dom->name) {
|
||||||
thread_id, (uintptr_t) _dom);
|
append_string(prefix, "%04" PRIxPTR ":%.10s:",
|
||||||
|
thread_id, _dom->name);
|
||||||
|
} else {
|
||||||
|
append_string(prefix, "%04" PRIxPTR ":0x%08" PRIxPTR ":",
|
||||||
|
thread_id, (uintptr_t) _dom);
|
||||||
|
}
|
||||||
if (task) {
|
if (task) {
|
||||||
append_string(prefix, "0x%08" PRIxPTR ":", (uintptr_t) task);
|
if (task->name) {
|
||||||
|
append_string(prefix, "%.10s:", task->name);
|
||||||
|
} else {
|
||||||
|
append_string(prefix, "0x%08" PRIxPTR ":", (uintptr_t) task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
trace_ln(thread_id, prefix, message);
|
trace_ln(thread_id, prefix, message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user