[countersyncd] fix otel actor log level #4193
Conversation
Signed-off-by: Janet Cui <janet970527@gmail.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This pull request aims to optimize the OtelActor logging by replacing the print_to_console configuration field with a runtime check using log::log_enabled!(log::Level::Debug). The intention is to avoid the cost of building log output unless Debug level logging is enabled, and to change the logging from Info to Debug level to reduce noise in production.
Changes:
- Replaced the
config.print_to_consolecheck withlog::log_enabled!(log::Level::Debug)to gate the call toprint_otel_metrics() - Changed all logging statements within
print_otel_metrics()frominfo!todebug!level
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Janet Cui <janet970527@gmail.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Janet Cui <janet970527@gmail.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Cherry-pick PR to msft-202412: Azure/sonic-swss.msft#204 |
|
@Janetxxx cherry pick PR didn't pass PR checker. Please check!!! |
3 similar comments
|
@Janetxxx cherry pick PR didn't pass PR checker. Please check!!! |
|
@Janetxxx cherry pick PR didn't pass PR checker. Please check!!! |
|
@Janetxxx cherry pick PR didn't pass PR checker. Please check!!! |
|
Cherry-pick PR to 202511: #4221 |
What I did Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled. Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging. Removing print_to_console simplifies config and relies solely on log levels to control output. Why I did it Avoids the cost of building log output unless Debug is enabled. Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
What I did Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled. Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging. Removing print_to_console simplifies config and relies solely on log levels to control output. Why I did it Avoids the cost of building log output unless Debug is enabled.
What I did Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled. Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging. Removing print_to_console simplifies config and relies solely on log levels to control output. Why I did it Avoids the cost of building log output unless Debug is enabled. Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
What I did Wrapping with log::log_enabled!(log::Level::Debug) avoids the cost of building log output unless Debug is enabled. Changing print_otel_metrics() to Debug level prevents noisy logs in normal operation; it only shows up when debugging. Removing print_to_console simplifies config and relies solely on log levels to control output. Why I did it Avoids the cost of building log output unless Debug is enabled.
What I did
Why I did it
Avoids the cost of building log output unless Debug is enabled.
How I verified it
Verified in internal setup.
Details if related