aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_log.h
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-07-19 14:05:18 -0700
committerMichael Bebenita <[email protected]>2010-07-19 14:05:18 -0700
commit00d1465d13980fc3acf650f182ee0723fbda0e06 (patch)
treea73cf5f0f20c0bee6722b33d975eb930919fefdf /src/rt/rust_log.h
parentAdd a test for an obvious-seeming (but not actually legal) kind of cast attem... (diff)
downloadrust-00d1465d13980fc3acf650f182ee0723fbda0e06.tar.xz
rust-00d1465d13980fc3acf650f182ee0723fbda0e06.zip
Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes.
Diffstat (limited to 'src/rt/rust_log.h')
-rw-r--r--src/rt/rust_log.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/rt/rust_log.h b/src/rt/rust_log.h
index bd32c155..06712066 100644
--- a/src/rt/rust_log.h
+++ b/src/rt/rust_log.h
@@ -1,22 +1,18 @@
-#ifndef RUST_LOG_H_
-#define RUST_LOG_H_
+#ifndef RUST_LOG_H
+#define RUST_LOG_H
class rust_dom;
+class rust_task;
+
+
class rust_log {
- rust_srv *_srv;
- rust_dom *_dom;
- uint32_t _type_bit_mask;
- bool _use_colors;
- uint32_t _indent;
- void trace_ln(char *message);
+
public:
rust_log(rust_srv *srv, rust_dom *dom);
virtual ~rust_log();
enum ansi_color {
- BLACK,
- GRAY,
WHITE,
RED,
LIGHTRED,
@@ -51,10 +47,19 @@ public:
void indent();
void outdent();
void reset_indent(uint32_t indent);
- void trace_ln(uint32_t type_bits, char *message);
- void trace_ln(ansi_color color, uint32_t type_bits, char *message);
+ void trace_ln(char *prefix, char *message);
+ void trace_ln(rust_task *task, uint32_t type_bits, char *message);
+ void trace_ln(rust_task *task, ansi_color color, uint32_t type_bits, char *message);
bool is_tracing(uint32_t type_bits);
- static ansi_color get_type_color(log_type type);
+
+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);
};
-#endif /* RUST_LOG_H_ */
+#endif /* RUST_LOG_H */