use super::debug_health_reasons_specs::LoggingSchemaDebugHealthReasonSpec;
use super::debug_summary_contracts::LoggingSchemaDebugHealthReason;
pub(super) fn build_all_expected_resources_present_reason() -> LoggingSchemaDebugHealthReason {
LoggingSchemaDebugHealthReason {
code: "all_expected_resources_present".to_string(),
severity: "info".to_string(),
count: 0,
message: "All expected logging tables and columns are present".to_string(),
}
}
pub(super) fn push_reason_if_nonzero(
reasons: &mut Vec<LoggingSchemaDebugHealthReason>,
spec: LoggingSchemaDebugHealthReasonSpec,
count: usize,
) {
if count == 0 {
return;
}
reasons.push(LoggingSchemaDebugHealthReason {
code: spec.code.to_string(),
severity: spec.severity.to_string(),
count,
message: spec.message.to_string(),
});
}