diff options
| author | Ted Horst <ted.horst@earthlink.net> | 2012-02-03 18:43:48 -0600 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-03 20:55:53 -0800 |
| commit | d65eabd5de4c41e4bc93b9c6c03d6278299ceb76 (patch) | |
| tree | f260590bfc3287a69502feaf77ed03e437762199 /src/comp/driver | |
| parent | f10d0e1bd4c05b2247589e2e843f72d6ec66a6a3 (diff) | |
| download | rust-d65eabd5de4c41e4bc93b9c6c03d6278299ceb76.tar.gz rust-d65eabd5de4c41e4bc93b9c6c03d6278299ceb76.zip | |
log to stderr instead of stdout
includes rustc diagnostics runtest updated to check stderr for errors
Diffstat (limited to 'src/comp/driver')
| -rw-r--r-- | src/comp/driver/diagnostic.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/comp/driver/diagnostic.rs b/src/comp/driver/diagnostic.rs index 72615addc11..5c0661fe51e 100644 --- a/src/comp/driver/diagnostic.rs +++ b/src/comp/driver/diagnostic.rs @@ -159,16 +159,16 @@ fn diagnosticcolor(lvl: level) -> u8 { fn print_diagnostic(topic: str, lvl: level, msg: str) { if str::is_not_empty(topic) { - io::stdout().write_str(#fmt["%s ", topic]); + io::stderr().write_str(#fmt["%s ", topic]); } if term::color_supported() { - term::fg(io::stdout(), diagnosticcolor(lvl)); + term::fg(io::stderr(), diagnosticcolor(lvl)); } - io::stdout().write_str(#fmt["%s:", diagnosticstr(lvl)]); + io::stderr().write_str(#fmt["%s:", diagnosticstr(lvl)]); if term::color_supported() { - term::reset(io::stdout()); + term::reset(io::stderr()); } - io::stdout().write_str(#fmt[" %s\n", msg]); + io::stderr().write_str(#fmt[" %s\n", msg]); } fn emit(cmsp: option<(codemap::codemap, span)>, @@ -201,10 +201,10 @@ fn highlight_lines(cm: codemap::codemap, sp: span, } // Print the offending lines for line: uint in display_lines { - io::stdout().write_str(#fmt["%s:%u ", fm.name, line + 1u]); + io::stderr().write_str(#fmt["%s:%u ", fm.name, line + 1u]); let s = codemap::get_line(fm, line as int); if !str::ends_with(s, "\n") { s += "\n"; } - io::stdout().write_str(s); + io::stderr().write_str(s); } if elided { let last_line = display_lines[vec::len(display_lines) - 1u]; @@ -213,7 +213,7 @@ fn highlight_lines(cm: codemap::codemap, sp: span, let out = ""; while indent > 0u { out += " "; indent -= 1u; } out += "...\n"; - io::stdout().write_str(out); + io::stderr().write_str(out); } @@ -238,6 +238,6 @@ fn highlight_lines(cm: codemap::codemap, sp: span, let width = hi.col - lo.col - 1u; while width > 0u { str::push_char(s, '~'); width -= 1u; } } - io::stdout().write_str(s + "\n"); + io::stderr().write_str(s + "\n"); } } |
