Dproano/clean live logs - #89
Conversation
LelsersLasers
left a comment
There was a problem hiding this comment.
couple small comments, mostly focused on the case of deleting the logs folder while daqapp is still running
| self.add_frame(raw_frame); | ||
| } | ||
|
|
||
| pub fn log_canfd_frame(&mut self, _frame: &slcan::CanFdFrame, _is_bus_1: bool) { |
There was a problem hiding this comment.
Can prob just delete this if it doesn't do anything and we don't intend to support CAN FD
| let file_path = self.folder_path.join(filename); | ||
| match File::create(&file_path) { | ||
| Ok(f) => self.file = Some(f), | ||
| Err(e) => { |
There was a problem hiding this comment.
this can fail b/c the top level logs folder got deleted
I think before creating the file you should re-call make all dirs? (and confirm that making the dirs doesn't fail if they already exist?)
| } | ||
| } | ||
|
|
||
| if let Some(ref mut file) = self.file { |
There was a problem hiding this comment.
this section also sometimes does not intuitive things when you delete the log folder. I can see it being common for us to delete the whole logs/ folder when we are done bench testing something but then we don't close/reopen daqapp.
unsure off the top of my head the best solution, but if the file got deleted, it needs to end up remaking the folders + remaking the file
No description provided.