Skip to content

Commit 725ff32

Browse files
authored
Merge pull request #153 from tnull/2023-08-fix-logger-setup
Fix logger symlink setup
2 parents 67ef682 + bd44692 commit 725ff32

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/logger.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ impl FilesystemLogger {
2929
.create(true)
3030
.append(true)
3131
.open(log_file_path.clone())
32-
.map_err(|_| ())?;
32+
.map_err(|e| eprintln!("ERROR: Failed to open log file: {}", e))?;
3333

3434
// Create a symlink to the current log file, with prior cleanup
3535
let log_file_symlink = parent_dir.join("ldk_node_latest.log");
36-
if log_file_symlink.as_path().exists() && log_file_symlink.as_path().is_symlink() {
37-
fs::remove_file(&log_file_symlink).map_err(|_| ())?;
36+
if log_file_symlink.as_path().is_symlink() {
37+
fs::remove_file(&log_file_symlink)
38+
.map_err(|e| eprintln!("ERROR: Failed to remove log file symlink: {}", e))?;
3839
}
39-
symlink(&log_file_name, &log_file_symlink).map_err(|_| ())?;
40+
symlink(&log_file_name, &log_file_symlink)
41+
.map_err(|e| eprintln!("ERROR: Failed to create log file symlink: {}", e))?;
4042
}
4143

4244
Ok(Self { file_path: log_file_path, level })

0 commit comments

Comments
 (0)