about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-06 18:29:58 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-06 18:29:58 -0800
commit3bd0338c19a594d538bc6dd4656c0cb8da9b9680 (patch)
tree2e50f33f5a8259655bba7fc3cc9b35d9bd800da7 /src
parent5563eab22709b2fbb0d737bcf62d740217a5718a (diff)
downloadrust-3bd0338c19a594d538bc6dd4656c0cb8da9b9680.tar.gz
rust-3bd0338c19a594d538bc6dd4656c0cb8da9b9680.zip
Revert "log to stderr instead of stdout"
This is causing mysterious hangs on windows. Issue #1769.

This reverts commit d65eabd5de4c41e4bc93b9c6c03d6278299ceb76.
Diffstat (limited to 'src')
-rw-r--r--src/comp/driver/diagnostic.rs18
-rw-r--r--src/compiletest/runtest.rs4
-rw-r--r--src/rt/rust_srv.cpp6
3 files changed, 16 insertions, 12 deletions
diff --git a/src/comp/driver/diagnostic.rs b/src/comp/driver/diagnostic.rs
index 427bac77197..ebda3956bfd 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::stderr().write_str(#fmt["%s ", topic]);
+        io::stdout().write_str(#fmt["%s ", topic]);
     }
     if term::color_supported() {
-        term::fg(io::stderr(), diagnosticcolor(lvl));
+        term::fg(io::stdout(), diagnosticcolor(lvl));
     }
-    io::stderr().write_str(#fmt["%s:", diagnosticstr(lvl)]);
+    io::stdout().write_str(#fmt["%s:", diagnosticstr(lvl)]);
     if term::color_supported() {
-        term::reset(io::stderr());
+        term::reset(io::stdout());
     }
-    io::stderr().write_str(#fmt[" %s\n", msg]);
+    io::stdout().write_str(#fmt[" %s\n", msg]);
 }
 
 fn emit(cmsp: option<(codemap::codemap, span)>,
@@ -202,10 +202,10 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
     }
     // Print the offending lines
     for line: uint in display_lines {
-        io::stderr().write_str(#fmt["%s:%u ", fm.name, line + 1u]);
+        io::stdout().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::stderr().write_str(s);
+        io::stdout().write_str(s);
     }
     if elided {
         let last_line = display_lines[vec::len(display_lines) - 1u];
@@ -214,7 +214,7 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
         let out = "";
         while indent > 0u { out += " "; indent -= 1u; }
         out += "...\n";
-        io::stderr().write_str(out);
+        io::stdout().write_str(out);
     }
 
 
@@ -239,7 +239,7 @@ 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::stderr().write_str(s + "\n");
+        io::stdout().write_str(s + "\n");
     }
 }
 
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 2ba4517c0e4..a3920ccb184 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -199,7 +199,7 @@ fn check_error_patterns(props: test_props,
 
     let next_err_idx = 0u;
     let next_err_pat = props.error_patterns[next_err_idx];
-    for line: str in str::split(procres.stderr, '\n' as u8) {
+    for line: str in str::split(procres.stdout, '\n' as u8) {
         if str::find(line, next_err_pat) > 0 {
             #debug("found error pattern %s", next_err_pat);
             next_err_idx += 1u;
@@ -246,7 +246,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
     //    filename:line1:col1: line2:col2: *warning:* msg
     // where line1:col1: is the starting point, line2:col2:
     // is the ending point, and * represents ANSI color codes.
-    for line: str in str::split(procres.stderr, '\n' as u8) {
+    for line: str in str::split(procres.stdout, '\n' as u8) {
         let was_expected = false;
         vec::iteri(expected_errors) {|i, ee|
             if !found_flags[i] {
diff --git a/src/rt/rust_srv.cpp b/src/rt/rust_srv.cpp
index 9192af511d9..758174a4ebb 100644
--- a/src/rt/rust_srv.cpp
+++ b/src/rt/rust_srv.cpp
@@ -25,7 +25,11 @@ rust_srv::realloc(void *p, size_t bytes) {
 
 void
 rust_srv::log(char const *msg) {
-    fprintf(stderr, "rust: %s\n", msg);
+    printf("rust: %s\n", msg);
+    // FIXME: flushing each time is expensive, but at the moment
+    // necessary to get output through before a rust_task::fail
+    // call. This should be changed.
+    fflush(stdout);
 }
 
 void