diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-27 12:33:22 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-28 12:23:00 -0700 |
| commit | 75985ab75ed216cd8c873c9ef08cd88708f8354f (patch) | |
| tree | b5702491c282373990bb13751d33d867dd5aabce /src/rt/rust_log.cpp | |
| parent | 86f337484eeabb5e74060d3549974b3bd85e7f3b (diff) | |
| download | rust-75985ab75ed216cd8c873c9ef08cd88708f8354f.tar.gz rust-75985ab75ed216cd8c873c9ef08cd88708f8354f.zip | |
Remove color-related code from rust_log
This is all dead. If someone decides they want color it will be easy to redo.
Diffstat (limited to 'src/rt/rust_log.cpp')
| -rw-r--r-- | src/rt/rust_log.cpp | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp index a2ab77b1b55..c23a38bc1da 100644 --- a/src/rt/rust_log.cpp +++ b/src/rt/rust_log.cpp @@ -1,6 +1,5 @@ /* - * Logging infrastructure that aims to support multi-threading, - * and ansi colors. + * Logging infrastructure that aims to support multi-threading */ #include "rust_internal.h" @@ -9,13 +8,6 @@ #include <stdlib.h> #include <string.h> -static const char * _foreground_colors[] = { "[37m", - "[31m", "[1;31m", - "[32m", "[1;32m", - "[33m", "[1;33m", - "[31m", "[1;31m", - "[35m", "[1;35m", - "[36m", "[1;36m" }; /** * Synchronizes access to the underlying logging mechanism. @@ -25,8 +17,7 @@ static uint32_t _last_thread_id; rust_log::rust_log(rust_srv *srv, rust_scheduler *sched) : _srv(srv), - _sched(sched), - _use_colors(getenv("RUST_COLOR_LOG")) { + _sched(sched) { } rust_log::~rust_log() { @@ -45,11 +36,6 @@ hash(uintptr_t ptr) { return (uint16_t) ptr; } -const char * -get_color(uintptr_t ptr) { - return _foreground_colors[hash(ptr) % rust_log::LIGHTTEAL]; -} - char * copy_string(char *dst, const char *src, size_t length) { return strncpy(dst, src, length) + length; @@ -67,21 +53,6 @@ append_string(char *buffer, const char *format, ...) { return buffer; } -char * -append_string(char *buffer, rust_log::ansi_color color, - const char *format, ...) { - if (buffer != NULL && format) { - append_string(buffer, "\x1b%s", _foreground_colors[color]); - va_list args; - va_start(args, format); - size_t off = strlen(buffer); - vsnprintf(buffer + off, BUF_BYTES - off, format, args); - va_end(args); - append_string(buffer, "\x1b[0m"); - } - return buffer; -} - void rust_log::trace_ln(uint32_t thread_id, char *prefix, char *message) { char buffer[BUF_BYTES] = ""; |
