about summary refs log tree commit diff
path: root/src/rt/rust_timer.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-04-19 12:21:57 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-04-19 16:57:13 +0200
commit880be6a94013ba0b7791b0ca1b6e16104f2f0a1c (patch)
treead8c673f13ec8d2d879175be1a006b08cc6d26d3 /src/rt/rust_timer.cpp
parent6511d471bafd446026462ce0dba8ef5e2ebf462f (diff)
downloadrust-880be6a94013ba0b7791b0ca1b6e16104f2f0a1c.tar.gz
rust-880be6a94013ba0b7791b0ca1b6e16104f2f0a1c.zip
Overhaul logging system in runtime
See https://github.com/graydon/rust/wiki/Logging-vision

The runtime logging categories are now treated in the same way as
modules in compiled code. Each domain now has a log_lvl that can be
used to restrict the logging from that domain (will be used to allow
logging to be restricted to a single domain).

Features dropped (can be brought back to life if there is interest):
  - Logger indentation
  - Multiple categories per log statement
  - I possibly broke some of the color code -- it confuses me
Diffstat (limited to 'src/rt/rust_timer.cpp')
-rw-r--r--src/rt/rust_timer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rt/rust_timer.cpp b/src/rt/rust_timer.cpp
index 40044e03678..79cb1615bbc 100644
--- a/src/rt/rust_timer.cpp
+++ b/src/rt/rust_timer.cpp
@@ -30,7 +30,7 @@ timer_loop(void *ptr) {
     // We were handed the rust_timer that owns us.
     rust_timer *timer = (rust_timer *)ptr;
     rust_dom *dom = timer->dom;
-    DLOG(dom, rust_log::TIMER, "in timer 0x%" PRIxPTR, (uintptr_t)timer);
+    DLOG(dom, timer, "in timer 0x%" PRIxPTR, (uintptr_t)timer);
     size_t ms = TIME_SLICE_IN_MS;
 
     while (!timer->exit_flag) {
@@ -39,7 +39,7 @@ timer_loop(void *ptr) {
 #else
         usleep(ms * 1000);
 #endif
-        DLOG(dom, rust_log::TIMER, "timer 0x%" PRIxPTR
+        DLOG(dom, timer, "timer 0x%" PRIxPTR
         " interrupting domain 0x%" PRIxPTR, (uintptr_t) timer,
                  (uintptr_t) dom);
         dom->interrupt_flag = 1;
@@ -54,7 +54,7 @@ timer_loop(void *ptr) {
 
 rust_timer::rust_timer(rust_dom *dom) :
     dom(dom), exit_flag(0) {
-    DLOG(dom, rust_log::TIMER, "creating timer for domain 0x%" PRIxPTR, dom);
+    DLOG(dom, timer, "creating timer for domain 0x%" PRIxPTR, dom);
 #if defined(__WIN32__)
     thread = CreateThread(NULL, 0, timer_loop, this, 0, NULL);
     dom->win32_require("CreateThread", thread != NULL);