Skip to content

Commit 16fb847

Browse files
committed
[temp]edit(condition): just try to handle some simple edge cases
1 parent 7a32d64 commit 16fb847

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/server/src/log/logger.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ impl Logging {
260260
let logs_path = if config.file_enabled {
261261
let base_directory = PathBuf::from(base_directory);
262262
let logs_subdirectory = PathBuf::from(config.path.clone());
263-
let logs_path = base_directory.join(logs_subdirectory.clone());
263+
let logs_subdirectory = logs_subdirectory
264+
.canonicalize()
265+
.unwrap_or(logs_subdirectory);
266+
let logs_path = base_directory.join(logs_subdirectory);
264267

265268
if let Err(e) = fs::create_dir_all(&logs_path) {
266269
warn!("Failed to create logs directory {logs_path:?}: {e}");
@@ -642,6 +645,12 @@ impl Default for Logging {
642645
}
643646
}
644647

648+
impl Drop for Logging {
649+
fn drop(&mut self) {
650+
self.rotation_should_stop.store(true, Ordering::Relaxed);
651+
}
652+
}
653+
645654
// This is a workaround for a bug with `with_ansi` setting in tracing
646655
// Bug thread: https://github.com/tokio-rs/tracing/issues/3116
647656
struct NoAnsiFields {}

0 commit comments

Comments
 (0)