simonsobs / socs

Simons Observatory specific OCS agents.
BSD 2-Clause "Simplified" License
12 stars 12 forks source link

Move HWP encoder timeout packet log to debug level #684

Closed BrianJKoopman closed 4 months ago

BrianJKoopman commented 4 months ago

Description

This PR changes the log level of the 'Received timeout packet.' message in the HWP Encoder agent from 'error' to 'debug'. If the HWP is not spinning, this packet is expected as normal behavior.

I also add the setup that allows changing the log level via environment variable, so it can be changed in the Docker Compose config.

Motivation and Context

When the HWP is not spinning, this packet is received every 10 seconds, filling the logs with this message. This makes it difficult to see any other messages that might be more relevant for debugging.

How Has This Been Tested?

Not yet tested, though is a straightforward change. The log level selection is used in other agents.

Types of changes

Checklist:

BrianJKoopman commented 4 months ago

This is okay, but can you explain exactly how we can change the log level through the Docker Compose config?

Yes, if you add this line to the environment block:

environment:
  - "LOGLEVEL=debug"

Also described here, for future reference: https://ocs.readthedocs.io/en/main/developer/agent_references/logging.html