summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2022-11-05 21:09:33 +0100
committerqkzk <qu3nt1n@gmail.com>2022-11-05 21:09:33 +0100
commit8315ff1bb852e9d29f275e5c3568eaefa25998c5 (patch)
tree5f07195c4694847db9618d808fc6155bbc3b057e
parent2fe45b9ffd8d96c0c5565fddb8171574c8e7d4b3 (diff)
fix existing log path makes the app crashlogs
-rw-r--r--readme.md5
-rw-r--r--src/log.rs4
2 files changed, 3 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index 71fbae9..ff273f4 100644
--- a/readme.md
+++ b/readme.md
@@ -96,6 +96,7 @@
- [x] FIX: marks saved without newlines
- [x] drag & drop: exec and find dragon-drop
- [x] optional numbers in preview
+- [x] logging with rotating log files.
## TODO
@@ -116,10 +117,6 @@
- [ ] compress
- [x] decompress selected file with ctrl+x
- [x] preview
-- [ ] logging.
- - Not as simple as I thought it would be. FileRotate seems to work but the "log" object is mutated when we write to it... So it can't be shared (multiple borrow mut)
- - Standard logging uses macros like info! debug! etc. but the output isn't defined and seems to be captured from outside. Not what I want.
- - What do I want ?
## BUGS
diff --git a/src/log.rs b/src/log.rs
index b428f10..0938eb0 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -26,8 +26,8 @@ pub fn set_logger() -> FmResult<Handle> {
let compound_policy =
CompoundPolicy::new(Box::new(size_trigger), Box::new(fixed_window_roller));
let log_path = shellexpand::tilde(LOG_PATH).to_string();
- std::fs::create_dir_all(&log_path)?;
-
+ // Don't propagate the error with ? since it crashes the application.
+ let _ = std::fs::create_dir_all(&log_path);
// Log Trace level output to file where trace is the default level
// and the programmatically specified level to stderr.
let config = Config::builder()