cleanup logging

This commit is contained in:
Blake Blackshear 2021-08-16 07:38:53 -05:00
parent 927f56ab9f
commit b143e11e0e
2 changed files with 9 additions and 16 deletions

View File

@ -68,13 +68,14 @@ class LocalObjectDetector(ObjectDetector):
experimental_delegates=[edge_tpu_delegate], experimental_delegates=[edge_tpu_delegate],
) )
except ValueError: except ValueError:
logger.info("No EdgeTPU detected.") logger.error(
"No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors."
)
raise raise
else: else:
logger.error("****************************************************") logger.warning(
logger.error(f"** CPU detectors are not recommended and should") "CPU detectors are not recommended and should only be used for testing or for trial purposes."
logger.error(f"** only be used for testing or for trial purposes.") )
logger.error(("****************************************************"))
self.interpreter = tflite.Interpreter( self.interpreter = tflite.Interpreter(
model_path="/cpu_model.tflite", num_threads=num_threads model_path="/cpu_model.tflite", num_threads=num_threads
) )

View File

@ -217,20 +217,12 @@ class CameraWatchdog(threading.Thread):
if not self.capture_thread.is_alive(): if not self.capture_thread.is_alive():
self.logger.error( self.logger.error(
"***********************************************************************" f"FFMPEG process crashed unexpectedly for {self.camera_name}."
) )
self.logger.error( self.logger.error(
f"** FFMPEG process crashed unexpectedly for {self.camera_name}." "The following ffmpeg logs include the last 100 lines prior to exit."
)
self.logger.error(
f"** The following ffmpeg logs include the last 100 lines prior to exit."
)
self.logger.error(
f"** You may have invalid args defined for this camera."
)
self.logger.error(
"***********************************************************************"
) )
self.logger.error("You may have invalid args defined for this camera.")
self.logpipe.dump() self.logpipe.dump()
self.start_ffmpeg_detect() self.start_ffmpeg_detect()
elif now - self.capture_thread.current_frame.value > 20: elif now - self.capture_thread.current_frame.value > 20: