diff --git a/crates/util/src/util.rs b/crates/util/src/util.rs index a161b8bac2b59fd1280ebd8e8667f1f99bc9337b..50fc070009ebf67b4f1bb3b29954e6437a91fe7d 100644 --- a/crates/util/src/util.rs +++ b/crates/util/src/util.rs @@ -378,9 +378,13 @@ fn log_error_with_caller(caller: core::panic::Location<'_>, error: E, level: where E: std::fmt::Debug, { + #[cfg(not(target_os = "windows"))] + let file = caller.file(); + #[cfg(target_os = "windows")] + let file = caller.file().replace('\\', "/"); // In this codebase, the first segment of the file path is // the 'crates' folder, followed by the crate name. - let target = caller.file().split('/').nth(1); + let target = file.split('/').nth(1); log::logger().log( &log::Record::builder()