mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-08-04 13:25:27 +02:00
review logs
This commit is contained in:
parent
654f302ba8
commit
9e411d8a68
1 changed files with 5 additions and 4 deletions
|
@ -433,7 +433,7 @@ class PandoraBox:
|
||||||
self._log("Scan done in %ds, %d files scanned, %d files infected" %
|
self._log("Scan done in %ds, %d files scanned, %d files infected" %
|
||||||
((time.time() - scan_start_time),file_count,len(self.infected_files)))
|
((time.time() - scan_start_time),file_count,len(self.infected_files)))
|
||||||
logging.info(
|
logging.info(
|
||||||
f'duration="{int(time.time() - scan_start_time)}s", '\
|
f'duration="{int(time.time() - scan_start_time)}", '\
|
||||||
f'files_scanned="{file_count}", '\
|
f'files_scanned="{file_count}", '\
|
||||||
f'files_infected="{len(self.infected_files)}"')
|
f'files_infected="{len(self.infected_files)}"')
|
||||||
return "CLEAN"
|
return "CLEAN"
|
||||||
|
@ -456,14 +456,13 @@ class PandoraBox:
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self._log(f"Unexpected error: {str(ex)}")
|
self._log(f"Unexpected error: {str(ex)}")
|
||||||
logging.info(f'error="{str(ex)}"', exc_info=True)
|
logging.info(f'error="{str(ex)}"', exc_info=True)
|
||||||
finally:
|
|
||||||
self._log("Done.")
|
|
||||||
return "STOP"
|
return "STOP"
|
||||||
|
|
||||||
def _device_inserted(self, dev):
|
def _device_inserted(self, dev):
|
||||||
|
self._log("Device inserted")
|
||||||
|
logging.info("device-inserted")
|
||||||
self.device = dev
|
self.device = dev
|
||||||
self._log_device_info(self.device)
|
self._log_device_info(self.device)
|
||||||
logging.info("device_inserted")
|
|
||||||
if not self.has_curses:
|
if not self.has_curses:
|
||||||
self.display_image("WORK")
|
self.display_image("WORK")
|
||||||
else:
|
else:
|
||||||
|
@ -476,6 +475,8 @@ class PandoraBox:
|
||||||
return "INSERTED"
|
return "INSERTED"
|
||||||
|
|
||||||
def _device_removed(self):
|
def _device_removed(self):
|
||||||
|
self._log("Device removed")
|
||||||
|
logging.info("device-removed")
|
||||||
self.device = None
|
self.device = None
|
||||||
if not self.has_curses:
|
if not self.has_curses:
|
||||||
self.display_image("WAIT")
|
self.display_image("WAIT")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue