about summary refs log tree commit diff
path: root/src/rt/rust.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.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.cpp')
-rw-r--r--src/rt/rust.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index 66ca2dc2643..56c5b4d6672 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -82,6 +82,8 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
 
     if (crate->abi_tag != ABI_X86_RUSTBOOT_CDECL)
         update_log_settings(crate_map, getenv("RUST_LOG"));
+    else
+        update_log_settings(NULL, getenv("RUST_LOG"));
     rust_srv *srv = new rust_srv();
     rust_kernel *kernel = new rust_kernel(srv);
     kernel->start();
@@ -89,14 +91,13 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
     rust_dom *dom = handle->referent();
     command_line_args *args = new (dom) command_line_args(dom, argc, argv);
 
-    DLOG(dom, rust_log::DOM, "startup: %d args in 0x%" PRIxPTR,
+    DLOG(dom, dom, "startup: %d args in 0x%" PRIxPTR,
              args->argc, (uintptr_t)args->args);
     for (int i = 0; i < args->argc; i++) {
-        DLOG(dom, rust_log::DOM,
-            "startup: arg[%d] = '%s'", i, args->argv[i]);
+        DLOG(dom, dom, "startup: arg[%d] = '%s'", i, args->argv[i]);
     }
 
-    if (dom->_log.is_tracing(rust_log::DWARF)) {
+    if (log_rt_dwarf) {
         rust_crate_reader create_reader(dom, crate);
     }