| 344 | } |
| 345 | |
| 346 | fn format_log_plain( |
| 347 | out: fern::FormatCallback, |
| 348 | message: &std::fmt::Arguments, |
| 349 | record: &log::Record, |
| 350 | ) { |
| 351 | let target = record.target(); |
| 352 | let simplified_target = if target.starts_with("webview:") { |
| 353 | "webview" |
| 354 | } else { |
| 355 | target |
| 356 | }; |
| 357 | |
| 358 | out.finish(format_args!( |
| 359 | "[{}][tid:{}][{}][{}] {}", |
| 360 | chrono::Local::now().format("%Y-%m-%dT%H:%M:%S%.3f"), |
| 361 | get_thread_id(), |
| 362 | record.level(), |
| 363 | simplified_target, |
| 364 | message |
| 365 | )) |
| 366 | } |
| 367 | |
| 368 | pub async fn cleanup_old_log_sessions() { |
| 369 | tokio::time::sleep(tokio::time::Duration::from_secs(10)).await; |