We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b8eac5 commit 799ec79Copy full SHA for 799ec79
crates/rust-analyzer/src/bin/logger.rs
@@ -48,7 +48,7 @@ impl Log for Logger {
48
return;
49
}
50
51
- let should_flush = match &self.file {
+ match &self.file {
52
Some(w) => {
53
let _ = writeln!(
54
w.lock(),
@@ -57,22 +57,21 @@ impl Log for Logger {
57
record.module_path().unwrap_or_default(),
58
record.args(),
59
);
60
- self.no_buffering
+
61
+ if self.no_buffering {
62
+ self.flush();
63
+ }
64
65
None => {
- eprintln!(
- "[{} {}] {}",
66
+ let message = format!(
67
+ "[{} {}] {}\n",
68
record.level(),
69
70
71
- true // flush stderr unconditionally
72
+ eprint!("{}", message);
73
74
};
-
- if should_flush {
- self.flush();
75
- }
76
77
78
fn flush(&self) {
0 commit comments