diff options
| author | Michael Bebenita <mbebenita@mozilla.com> | 2010-08-11 14:04:36 -0700 |
|---|---|---|
| committer | Michael Bebenita <mbebenita@mozilla.com> | 2010-08-11 16:08:45 -0700 |
| commit | ff93e5e196f02ac730fb8da64da888b8ad510d35 (patch) | |
| tree | b425a929cdc1800bc1316a28f386634dbed15d48 /src/rt/rust_log.cpp | |
| parent | f307688bf44404b371b91b3b2a67048088695fe1 (diff) | |
| download | rust-ff93e5e196f02ac730fb8da64da888b8ad510d35.tar.gz rust-ff93e5e196f02ac730fb8da64da888b8ad510d35.zip | |
Print domain and task names in log prefix.
Diffstat (limited to 'src/rt/rust_log.cpp')
| -rw-r--r-- | src/rt/rust_log.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp index 8e0897919f1..50a107d59df 100644 --- a/src/rt/rust_log.cpp +++ b/src/rt/rust_log.cpp @@ -145,13 +145,22 @@ rust_log::trace_ln(rust_task *task, char *message) { #if defined(__WIN32__) uint32_t thread_id = 0; #else - uint32_t thread_id = (uint32_t) pthread_self(); + uint32_t thread_id = hash((uint32_t) pthread_self()); #endif char prefix[1024] = ""; - append_string(prefix, "0x%08" PRIxPTR ":0x%08" PRIxPTR ":", - thread_id, (uintptr_t) _dom); + if (_dom->name) { + 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) { - 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); } |
