INNER CODE UNIT · Rust
open_log
jub0t/Concat · src/crates/concat-android/src/lib.rs:49
pub fn open_log() {
// Info is logcat's floor, as it always was; CONCAT_LOG is the
// ceiling over both sinks, so turning the file up to debug does not
// also flood logcat, and turning everything down still quiets it.
let logcat = android_logger::AndroidLogger::new(
android_logger::Config::default()
.with_max_level(log::LevelFilter::Info)
.with_tag("concat"),
);
concat::open_logging(Some(Box::new(logcat)));
forward_stderr();
}
/// Everything written to stderr is read back off a pipe and logged a
/// line at a time, so a stray `eprintln!` in a dependency reaches logcat
/// without that dependency knowing about phones. The app's own lines do
/// not come this way - they go through the facade, which on a phone
/// deliberately leaves stderr alone so a line cannot come back round