diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-11-05 21:09:33 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-11-05 21:09:33 +0100 |
commit | 8315ff1bb852e9d29f275e5c3568eaefa25998c5 (patch) | |
tree | 5f07195c4694847db9618d808fc6155bbc3b057e | |
parent | 2fe45b9ffd8d96c0c5565fddb8171574c8e7d4b3 (diff) |
fix existing log path makes the app crashlogs
-rw-r--r-- | readme.md | 5 | ||||
-rw-r--r-- | src/log.rs | 4 |
2 files changed, 3 insertions, 6 deletions
@@ -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 @@ -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() |