mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-15 01:01:25 +10:00
feat(process): add pre-launch log to file
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs::{File, OpenOptions},
|
||||
io::Write,
|
||||
path::PathBuf,
|
||||
process::{Child, Command},
|
||||
sync::LazyLock,
|
||||
@ -99,7 +100,7 @@ impl ProcessManager {
|
||||
info!("launching process {} in {}", command, install_dir);
|
||||
|
||||
let current_time = chrono::offset::Local::now();
|
||||
let log_file = OpenOptions::new()
|
||||
let mut log_file = OpenOptions::new()
|
||||
.write(true)
|
||||
.append(true)
|
||||
.read(true)
|
||||
@ -111,6 +112,13 @@ impl ProcessManager {
|
||||
)))
|
||||
.map_err(|v| v.to_string())?;
|
||||
|
||||
writeln!(
|
||||
log_file,
|
||||
"Drop: launching {} with args {:?} in {}",
|
||||
command, args, install_dir
|
||||
)
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let launch_process = Command::new(command)
|
||||
.current_dir(install_dir)
|
||||
.stdout(log_file)
|
||||
|
||||
Reference in New Issue
Block a user