aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_chan.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-04-19 12:21:57 +0200
committerMarijn Haverbeke <[email protected]>2011-04-19 16:57:13 +0200
commit880be6a94013ba0b7791b0ca1b6e16104f2f0a1c (patch)
treead8c673f13ec8d2d879175be1a006b08cc6d26d3 /src/rt/rust_chan.cpp
parentreplace error logging with log_err in stdlib and rustc (diff)
downloadrust-880be6a94013ba0b7791b0ca1b6e16104f2f0a1c.tar.xz
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_chan.cpp')
-rw-r--r--src/rt/rust_chan.cpp16
1 files changed, 7 insertions, 9 deletions
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<rust_port> *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);