rust/src/rt/rust_log.h

69 lines
1.4 KiB
C
Raw Normal View History

#ifndef RUST_LOG_H
#define RUST_LOG_H
2010-06-23 23:03:09 -05:00
class rust_dom;
class rust_task;
2010-06-23 23:03:09 -05:00
class rust_log {
2010-06-23 23:03:09 -05:00
public:
rust_log(rust_srv *srv, rust_dom *dom);
virtual ~rust_log();
enum ansi_color {
WHITE,
RED,
LIGHTRED,
GREEN,
LIGHTGREEN,
YELLOW,
LIGHTYELLOW,
BLUE,
LIGHTBLUE,
MAGENTA,
LIGHTMAGENTA,
TEAL,
LIGHTTEAL
};
enum log_type {
ERR = 0x1,
MEM = 0x2,
COMM = 0x4,
TASK = 0x8,
DOM = 0x10,
ULOG = 0x20,
TRACE = 0x40,
DWARF = 0x80,
CACHE = 0x100,
UPCALL = 0x200,
TIMER = 0x400,
GC = 0x800,
STDLIB = 0x1000,
SPECIAL = 0x2000,
KERN = 0x4000,
2010-10-11 18:40:18 -05:00
BT = 0x8000,
2010-06-23 23:03:09 -05:00
ALL = 0xffffffff
};
void indent();
void outdent();
void reset_indent(uint32_t indent);
void trace_ln(uint32_t thread_id, char *prefix, char *message);
void trace_ln(rust_task *task, uint32_t type_bits, char *message);
2010-07-28 02:11:28 -05:00
void trace_ln(rust_task *task, ansi_color color,
uint32_t type_bits, char *message);
2010-06-23 23:03:09 -05:00
bool is_tracing(uint32_t type_bits);
private:
rust_srv *_srv;
rust_dom *_dom;
uint32_t _type_bit_mask;
bool _use_labels;
bool _use_colors;
uint32_t _indent;
void trace_ln(rust_task *task, char *message);
2010-06-23 23:03:09 -05:00
};
#endif /* RUST_LOG_H */