mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
refactor logger flushing
This commit is contained in:
parent
799ec79f18
commit
60e304c7b6
@ -50,8 +50,9 @@ impl Log for Logger {
|
||||
|
||||
match &self.file {
|
||||
Some(w) => {
|
||||
let mut writer = w.lock();
|
||||
let _ = writeln!(
|
||||
w.lock(),
|
||||
writer,
|
||||
"[{} {}] {}",
|
||||
record.level(),
|
||||
record.module_path().unwrap_or_default(),
|
||||
@ -59,7 +60,7 @@ impl Log for Logger {
|
||||
);
|
||||
|
||||
if self.no_buffering {
|
||||
self.flush();
|
||||
let _ = writer.flush();
|
||||
}
|
||||
}
|
||||
None => {
|
||||
|
Loading…
Reference in New Issue
Block a user