Skip to content

Commit

Permalink
Fix logging bug on esp32 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
julianneswinoga committed Mar 10, 2024
1 parent bf3e4c3 commit c933540
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OATFWGUI/gui_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ def upload_fw(self):
@Slot()
def pio_upload_finished(self):
log.info(f'platformio upload finished')
self.avr_dude_logwatch.stop()
if self.logic_state.env_is_avr_based():
self.avr_dude_logwatch.stop()
exit_code = external_processes['platformio'].qproc.exitCode()
if exit_code == 0:
log.info('Normal exit')
Expand Down
3 changes: 3 additions & 0 deletions OATFWGUI/log_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def file_changed(self, _path: str):
self.log.info(line)

def stop(self):
if self.tempfile is None:
self.log.warning('Can\'t stop watching None file?')
return
self.log.debug(f'Cleaning up logged external file {self.tempfile.name}')
self.tempfile.close()
self.file_watcher.removePath(self.tempfile.name)
Expand Down

0 comments on commit c933540

Please sign in to comment.