Skip to content

Commit 1f690a4

Browse files
zhangxp1998Treehugger Robot
authored and
Treehugger Robot
committed
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
1 parent 39a6a4c commit 1f690a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

metrics_utils.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,12 @@ bool LoadAndReportTimeToReboot(MetricsReporterInterface* metrics_reporter,
363363
return false;
364364

365365
Time system_updated_at = Time::FromInternalValue(stored_value);
366-
TimeDelta time_to_reboot = clock->GetMonotonicTime() - system_updated_at;
366+
const auto current_time = clock->GetMonotonicTime();
367+
TimeDelta time_to_reboot = current_time - system_updated_at;
367368
if (time_to_reboot.ToInternalValue() < 0) {
368-
LOG(ERROR) << "time_to_reboot is negative - system_updated_at: "
369-
<< utils::ToString(system_updated_at);
369+
LOG(WARNING) << "time_to_reboot is negative - system_updated_at: "
370+
<< utils::ToString(system_updated_at) << " current time: "
371+
<< utils::ToString(current_time);
370372
return false;
371373
}
372374
metrics_reporter->ReportTimeToReboot(time_to_reboot.InMinutes());

0 commit comments

Comments
 (0)