#gpowerd Add state name to state change log.
The log message now includes the name of the state (e.g., "system_0_PowerState") that has changed, making the log more informative.
PiperOrigin-RevId: 839387662
Change-Id: I84028e9acabc6df630e13dd6ff270d5b44cb9be0
diff --git a/bmc/state_monitor_bmc.cc b/bmc/state_monitor_bmc.cc
index dc10784..18d9a2d 100644
--- a/bmc/state_monitor_bmc.cc
+++ b/bmc/state_monitor_bmc.cc
@@ -232,8 +232,8 @@
absl::string_view temp_ps_str =
PowerStateSpecifier_Name(temp_power_state);
LOG(INFO) << absl::StrFormat(
- "state changed from: %d (%s) to: %d (%s)", last_ps, last_ps_str,
- temp_power_state, temp_ps_str);
+ "%s changed from: %d (%s) to: %d (%s)", state_name,
+ last_ps, last_ps_str, temp_power_state, temp_ps_str);
// add new state power state to a new system proto
safepower_agent_proto::SystemState new_state;