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
This commit is contained in:
Marijn Haverbeke
2011-04-19 12:21:57 +02:00
parent 6511d471ba
commit 880be6a940
24 changed files with 463 additions and 637 deletions

View File

@@ -24,18 +24,16 @@ ptr_vec<T>::ptr_vec(rust_dom *dom) :
data(new (dom) T*[alloc])
{
I(dom, data);
DLOG(dom, rust_log::MEM,
"new ptr_vec(data=0x%" PRIxPTR ") -> 0x%" PRIxPTR,
(uintptr_t)data, (uintptr_t)this);
DLOG(dom, mem, "new ptr_vec(data=0x%" PRIxPTR ") -> 0x%" PRIxPTR,
(uintptr_t)data, (uintptr_t)this);
}
template <typename T>
ptr_vec<T>::~ptr_vec()
{
I(dom, data);
DLOG(dom, rust_log::MEM,
"~ptr_vec 0x%" PRIxPTR ", data=0x%" PRIxPTR,
(uintptr_t)this, (uintptr_t)data);
DLOG(dom, mem, "~ptr_vec 0x%" PRIxPTR ", data=0x%" PRIxPTR,
(uintptr_t)this, (uintptr_t)data);
I(dom, fill == 0);
dom->free(data);
}