Skip to content

Conversation

NicholasBratvold
Copy link
Contributor

Made a few logging changes:

  • A new log file is made for every new experiment. Previously a log file was created every time oracle was started.
  • Removed print statements and replaced with appropriate log level.
  • Updated log severity level of some logs to a more appropriate level.
  • Added in periodic img_metadata logging. Keys and Period defined as a scope constant.
  • Added experiment meta_data logging.
  • Added end of run message with cell counts.
  • Added some additional logs as needed.

Copy link
Collaborator

@i-jey i-jey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow - thanks for going through all this. Painstaking but long-needed. It looks good to me.

  • One thing to add to Grafana and which requires no changes to this PR
  • We currently output the net FPS of an experiment self.logger.info(f"Net FPS is {self.frame_count/runtime:.1f}").
  • A sudden change in net FPS could alert us to other issues (say due to a performance regression in a recent PR, or some other issue with the scopes - maybe running too hot and building up queues, slow SSD, etc.)

Aside, the one comment I made on ewma_filtering_utils.py is unrelated to the contents of this PR, I'll submit a separate one to fix that minor bug.

@NicholasBratvold NicholasBratvold requested a review from i-jey March 19, 2025 18:04
Copy link
Collaborator

@i-jey i-jey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup script looks good!

…oki, added experimentID to log to compensate.
@NicholasBratvold NicholasBratvold requested a review from i-jey March 20, 2025 01:02
Comment on lines 696 to 697
skip = not clinical and not sample_type == CULTURED_SAMPLE
if skip:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NBD but definitely more confusing that necessary. Could be:
if sample_type not in (CLINICAL_SAMPLE, CULTURED_SAMPLE):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agre, I will change that in another pull request but I want to keep this specific to logging.

return min_duty_cycle, max_duty_cycle, step_size
except Exception as e:
self.logger.exception(
self.logger.error(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you converted some of these instances to logger.error() and some to logger.exception()? AFAIK the only difference is whether the stack is included by default or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I converted all exceptions to errors so I believe there should be no logger.exceptions left. Previously, the severity levels were inconsistent so I tried to simplify things and keep more consistency in our severity level choices. Since we are also receiving alerts for tracebacks, I want them to be serious and not send us notifications for exceptions like the syringe being at its end of travel which tends to happen every run.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. I thought I had seen one the other way around but I was wrong!

@paul-lebel
Copy link
Collaborator

Aside from minor comments above, looks good to me!

@NicholasBratvold
Copy link
Contributor Author

Thanks for the review! I will merge it in.

@NicholasBratvold NicholasBratvold merged commit a9303da into develop Mar 27, 2025
4 checks passed
@i-jey i-jey deleted the improved_logging branch April 1, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants