(msg: &str)
| 117 | static LOG_PATH: OnceLock<std::path::PathBuf> = OnceLock::new(); |
| 118 | |
| 119 | fn log_mobile(msg: &str) { |
| 120 | #[cfg(target_os = "android")] |
| 121 | { |
| 122 | log::info!("{}", msg); |
| 123 | } |
| 124 | #[cfg(not(target_os = "android"))] |
| 125 | { |
| 126 | use std::io::Write; |
| 127 | eprintln!("{}", msg); |
| 128 | if let Some(path) = LOG_PATH.get() { |
| 129 | if let Ok(mut f) = std::fs::OpenOptions::new().create(true).append(true).open(path) { |
| 130 | let _ = writeln!(f, "{}", msg); |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | fn init_logging() { |
| 137 | #[cfg(target_os = "android")] |
no test coverage detected