diff --git a/update-engine/src/display/group_display.rs b/update-engine/src/display/group_display.rs index 464a77c4f8..6584a107a7 100644 --- a/update-engine/src/display/group_display.rs +++ b/update-engine/src/display/group_display.rs @@ -151,37 +151,34 @@ impl GroupDisplay { } self.stats.apply_result(result); - self.log_result(&state.prefix, &result); + + if result.before != result.after { + slog::info!( + self.log, + "add_event_report caused state transition"; + "prefix" => &state.prefix, + "before" => %result.before, + "after" => %result.after, + "current_stats" => ?self.stats, + "root_total_elapsed" => ?result.root_total_elapsed, + ); + } else { + slog::debug!( + self.log, + "add_event_report called, state did not change"; + "prefix" => &state.prefix, + "state" => %result.before, + "current_stats" => ?self.stats, + "root_total_elapsed" => ?result.root_total_elapsed, + ); + } + Ok(()) } else { Err(UnknownReportKey {}) } } - fn log_result(&self, prefix: &str, result: &AddEventReportResult) { - slog::debug!( - self.log, - "add_event_report called"; - "prefix" => prefix, - "before" => %result.before, - "after" => %result.after, - "stats" => ?self.stats, - "root_total_elapsed" => ?result.root_total_elapsed, - ); - - if result.before != result.after { - slog::info!( - self.log, - "add_event_report caused state transition"; - "prefix" => prefix, - "before" => %result.before, - "after" => %result.after, - "stats" => ?self.stats, - "root_total_elapsed" => ?result.root_total_elapsed, - ); - } - } - /// Writes a "Status" or "Summary" line to the writer with statistics. pub fn write_stats(&mut self, header: &str) -> std::io::Result<()> { // Add a blank prefix which is equal to the maximum width of known prefixes.