From dc00983539309ab36f8b26c7ae14a20f676e5886 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 3 Mar 2025 14:46:19 +0100 Subject: [PATCH] Handle the case where the path is already absolute --- runtime/src/log.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/src/log.rs b/runtime/src/log.rs index f91d326f..b626639a 100644 --- a/runtime/src/log.rs +++ b/runtime/src/log.rs @@ -78,6 +78,13 @@ pub fn init_logging() { fn convert_log_path_to_string(log_path: &FileSpec) -> String { let log_path = log_path.as_pathbuf(None); + + // Case: The path is already absolute: + if log_path.is_absolute() { + return log_path.to_str().unwrap().to_string(); + } + + // Case: The path is relative. Let's try to convert it to an absolute path: match log_path.canonicalize() { // Case: The path exists: Ok(log_path) => log_path.to_str().unwrap().to_string(),