Lower severity level of metric util logs
Metric reporting errors are non-fatal, so use log level WARNING instead
of ERROR.
Test: th
Change-Id: Ia00937c8d53be1ef4a8e79a8fa62970efda7b61b
diff --git a/metrics_utils.cc b/metrics_utils.cc
index ade024a..ec35fe2 100644
--- a/metrics_utils.cc
+++ b/metrics_utils.cc
@@ -363,10 +363,12 @@
return false;
Time system_updated_at = Time::FromInternalValue(stored_value);
- TimeDelta time_to_reboot = clock->GetMonotonicTime() - system_updated_at;
+ const auto current_time = clock->GetMonotonicTime();
+ TimeDelta time_to_reboot = current_time - system_updated_at;
if (time_to_reboot.ToInternalValue() < 0) {
- LOG(ERROR) << "time_to_reboot is negative - system_updated_at: "
- << utils::ToString(system_updated_at);
+ LOG(WARNING) << "time_to_reboot is negative - system_updated_at: "
+ << utils::ToString(system_updated_at) << " current time: "
+ << utils::ToString(current_time);
return false;
}
metrics_reporter->ReportTimeToReboot(time_to_reboot.InMinutes());