diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-05-11 19:25:03 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-05-11 19:25:03 +0200 |
commit | 2b1fdc0de02748a9a4cf021c3ca3f7f18e6b4440 (patch) | |
tree | 79bc882dff2f9e3b481c0fdb8ae7bf72c3d49662 | |
parent | 134e163580b6598c574ca8dbba1535284a730734 (diff) |
append .log to file path in the correct way
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index a41c160..9fdd06a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,7 @@ fn start() -> anyhow::Result<()> { writeln!(&mut stdout)?; thread::spawn(move || { - log(child, &service_name).expect("logging failed"); + log(child, service_name).expect("logging failed"); }); } Err(e) => { @@ -53,9 +53,9 @@ fn start() -> anyhow::Result<()> { Ok(()) } -fn log(child: Child, service_name: &str) -> anyhow::Result<()> { +fn log(child: Child, service_name: String) -> anyhow::Result<()> { let mut stdout = StandardStream::stdout(ColorChoice::Always); - let mut file = File::create(Path::new("/data").join(service_name).join(".log"))?; + let mut file = File::create(Path::new("/data").join(service_name.clone() + ".log"))?; let mut r = BufReader::new(child.stdout.expect("no child stdout")); loop { |