mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
refactor logger flushing
This commit is contained in:
parent
799ec79f18
commit
60e304c7b6
1 changed files with 3 additions and 2 deletions
|
@ -50,8 +50,9 @@ impl Log for Logger {
|
||||||
|
|
||||||
match &self.file {
|
match &self.file {
|
||||||
Some(w) => {
|
Some(w) => {
|
||||||
|
let mut writer = w.lock();
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
w.lock(),
|
writer,
|
||||||
"[{} {}] {}",
|
"[{} {}] {}",
|
||||||
record.level(),
|
record.level(),
|
||||||
record.module_path().unwrap_or_default(),
|
record.module_path().unwrap_or_default(),
|
||||||
|
@ -59,7 +60,7 @@ impl Log for Logger {
|
||||||
);
|
);
|
||||||
|
|
||||||
if self.no_buffering {
|
if self.no_buffering {
|
||||||
self.flush();
|
let _ = writer.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue