MCPcopy Create free account
hub / github.com/evilsocket/cake / log_mobile

Function log_mobile

cake-mobile/src/lib.rs:119–134  ·  view source on GitHub ↗
(msg: &str)

Source from the content-addressed store, hash-verified

117static LOG_PATH: OnceLock<std::path::PathBuf> = OnceLock::new();
118
119fn 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
136fn init_logging() {
137 #[cfg(target_os = "android")]

Callers 9

stop_workerFunction · 0.85
update_statusFunction · 0.85
update_serving_statusFunction · 0.85
set_cache_dirFunction · 0.85
start_workerFunction · 0.85
run_zero_config_workerFunction · 0.85
run_direct_workerFunction · 0.85
run_text_workerFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected