tapis-project / camera-traps

BSD 3-Clause "New" or "Revised" License
5 stars 9 forks source link

Enhanced python plugin logging #22

Open richcar58 opened 1 year ago

richcar58 commented 1 year ago

Modifications to the image_gen_plugin and image_score_plugin should include using the logging API to write log messages rather than writing to stdout. In addition, the image_gen_plugin should follow these practices:

  1. Do not log the list of all files in the input directory when processing each file in that directory. Instead, print the list of all files one time if TRACE level logging is turned on.
  2. When processing each file, log an INFO record that reads something like "Processing file n of x", where n is the current processed file count and x is the total number of files in the directory.
  3. When processing each file, log an INFO record that indicates the original file name and the uuid assigned to it. Something like "myimage.jpg -> uuu-xxx" is fine.
  4. Use DEBUG level logging for recording loop information and other information needed to debug the plugin. For example, log records like "Bottom of send_images loop; index: 2; index_value: 2; initial_index: 0" only need to be written when debugging loop execution.

In general, use INFO level logging for capturing useful information under normal processing where it's important to minimize the noise and size of the log; use DEBUG for troubleshooting information; and use TRACE for absolutely everything we'll ever want to record. Of course, ERROR and WARN should be used to records problems or possible problems.

joestubbs commented 1 year ago

Hi @serenashah -- can you give an update on where this issue is?