about summary refs log tree commit diff
path: root/src/rt/rust_log.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-11-07 14:14:36 -0800
committerBrian Anderson <banderson@mozilla.com>2011-11-07 14:14:36 -0800
commitb0c2416270502c124e031b5e86a74cb14eff7662 (patch)
tree23bc6e7dead38a7e8f07d40270ca164ad81a22a9 /src/rt/rust_log.cpp
parent369fc5e4802ec618ba10a52cf52fa52069fa5e77 (diff)
downloadrust-b0c2416270502c124e031b5e86a74cb14eff7662.tar.gz
rust-b0c2416270502c124e031b5e86a74cb14eff7662.zip
Clean up logging output. Closes #1088
Diffstat (limited to 'src/rt/rust_log.cpp')
-rw-r--r--src/rt/rust_log.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index 270b716679d..226ff2ff159 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -13,7 +13,6 @@
  * Synchronizes access to the underlying logging mechanism.
  */
 static lock_and_signal _log_lock;
-static uint32_t _last_thread_id;
 
 rust_log::rust_log(rust_srv *srv, rust_scheduler *sched) :
     _srv(srv),
@@ -67,26 +66,29 @@ append_string(char *buffer, const char *format, ...) {
 }
 
 void
-rust_log::trace_ln(uint32_t thread_id, char *prefix, char *message) {
+rust_log::trace_ln(char *prefix, char *message) {
     char buffer[BUF_BYTES] = "";
     _log_lock.lock();
-    append_string(buffer, "%-34s", prefix);
+    append_string(buffer, "%s", prefix);
     append_string(buffer, "%s", message);
-    if (_last_thread_id != thread_id) {
-        _last_thread_id = thread_id;
-        _srv->log("---");
-    }
     _srv->log(buffer);
     _log_lock.unlock();
 }
 
 void
 rust_log::trace_ln(rust_task *task, uint32_t level, char *message) {
+
+
+    // FIXME: The scheduler and task names used to have meaning,
+    // but they are always equal to 'main' currently
+#if 0
+
 #if defined(__WIN32__)
     uint32_t thread_id = 0;
 #else
     uint32_t thread_id = hash((uintptr_t) pthread_self());
 #endif
+
     char prefix[BUF_BYTES] = "";
     if (_sched && _sched->name) {
         append_string(prefix, "%04" PRIxPTR ":%.10s:",
@@ -102,7 +104,11 @@ rust_log::trace_ln(rust_task *task, uint32_t level, char *message) {
             append_string(prefix, "0x%08" PRIxPTR ":", (uintptr_t) task);
         }
     }
-    trace_ln(thread_id, prefix, message);
+#else
+    char prefix[BUF_BYTES] = "";
+#endif
+
+    trace_ln(prefix, message);
 }
 
 // Reading log directives and setting log level vars