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_dom.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/rt/rust_dom.h') diff --git a/src/rt/rust_dom.h b/src/rt/rust_dom.h index be3ca2f9..fa61aa79 100644 --- a/src/rt/rust_dom.h +++ b/src/rt/rust_dom.h @@ -14,6 +14,7 @@ struct rust_dom : public kernel_owned, rc_base // glue. rust_crate const *root_crate; rust_log _log; + uint32_t log_lvl; rust_srv *srv; memory_region local_region; memory_region synchronized_region; @@ -47,16 +48,12 @@ struct rust_dom : public kernel_owned, rc_base // Only a pointer to 'name' is kept, so it must live as long as this // domain. rust_dom(rust_kernel *kernel, - rust_message_queue *message_queue, rust_srv *srv, - rust_crate const *root_crate, const char *name); + rust_message_queue *message_queue, rust_srv *srv, + rust_crate const *root_crate, const char *name); ~rust_dom(); void activate(rust_task *task); - void log(rust_task *task, uint32_t logbit, char const *fmt, ...); - void log(uint32_t logbit, char const *fmt, ...); + void log(rust_task *task, uint32_t level, char const *fmt, ...); rust_log & get_log(); - void logptr(char const *msg, uintptr_t ptrval); - template - void logptr(char const *msg, T* ptrval); void fail(); void *malloc(size_t size); void *malloc(size_t size, memory_region::memory_region_type type); @@ -83,7 +80,6 @@ struct rust_dom : public kernel_owned, rc_base int start_main_loop(); void log_state(); - static void log_all_state(); rust_task *create_task(rust_task *spawner, const char *name); }; -- cgit v1.2.3