Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ use std::mem::MaybeUninit;
use std::sync::OnceLock;

use crate::arrays::{fill_tag_bytes, uninit_array};
use crate::platform_log_writer::PlatformLogWriter;
pub use crate::platform_log_writer::PlatformLogWriter;
pub use config::Config;
pub use env_filter::{Builder as FilterBuilder, Filter};
pub use id::LogId;
Expand Down Expand Up @@ -202,9 +202,6 @@ impl Log for AndroidLogger {
),
_ => fmt::write(&mut writer, *record.args()),
};

// output the remaining message (this would usually be the most common case)
writer.flush();
}

fn flush(&self) {}
Expand Down
6 changes: 6 additions & 0 deletions src/platform_log_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ impl fmt::Write for PlatformLogWriter<'_> {
}
}

impl Drop for PlatformLogWriter<'_> {
fn drop(&mut self) {
self.flush();
}
}

#[cfg(test)]
pub mod tests {
use crate::arrays::slice_assume_init_ref;
Expand Down
Loading