From 880be6a94013ba0b7791b0ca1b6e16104f2f0a1c Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 19 Apr 2011 12:21:57 +0200 Subject: 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 --- src/rt/rust_chan.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/rt/rust_chan.cpp') diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp index a8857960..fdc7f270 100644 --- a/src/rt/rust_chan.cpp +++ b/src/rt/rust_chan.cpp @@ -13,15 +13,13 @@ rust_chan::rust_chan(rust_task *task, if (port) { associate(port); } - LOG(task, rust_log::MEM | rust_log::COMM, - "new rust_chan(task=0x%" PRIxPTR - ", port=0x%" PRIxPTR ") -> chan=0x%" PRIxPTR, - (uintptr_t) task, (uintptr_t) port, (uintptr_t) this); + LOG(task, comm, "new rust_chan(task=0x%" PRIxPTR + ", port=0x%" PRIxPTR ") -> chan=0x%" PRIxPTR, + (uintptr_t) task, (uintptr_t) port, (uintptr_t) this); } rust_chan::~rust_chan() { - LOG(task, rust_log::MEM | rust_log::COMM, - "del rust_chan(task=0x%" PRIxPTR ")", (uintptr_t) this); + LOG(task, comm, "del rust_chan(task=0x%" PRIxPTR ")", (uintptr_t) this); A(task->dom, is_associated() == false, "Channel must be disassociated before being freed."); @@ -33,7 +31,7 @@ rust_chan::~rust_chan() { void rust_chan::associate(maybe_proxy *port) { this->port = port; if (port->is_proxy() == false) { - LOG(task, rust_log::TASK, + LOG(task, task, "associating chan: 0x%" PRIxPTR " with port: 0x%" PRIxPTR, this, port); this->port->referent()->chans.push(this); @@ -51,7 +49,7 @@ void rust_chan::disassociate() { A(task->dom, is_associated(), "Channel must be associated with a port."); if (port->is_proxy() == false) { - LOG(task, rust_log::TASK, + LOG(task, task, "disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR, this, port->referent()); port->referent()->chans.swap_delete(this); @@ -84,7 +82,7 @@ void rust_chan::send(void *sptr) { } else { rust_port *target_port = port->referent(); if (target_port->task->blocked_on(target_port)) { - DLOG(dom, rust_log::COMM, "dequeued in rendezvous_ptr"); + DLOG(dom, comm, "dequeued in rendezvous_ptr"); buffer.dequeue(target_port->task->rendezvous_ptr); target_port->task->rendezvous_ptr = 0; target_port->task->wakeup(target_port); -- cgit v1.2.3