feat: improve session result logging (#1123)

- logs the session result as an info level message without notification instead of debug
- does not log that no notification was sent if there are no notifications enabled
pull/1139/head
nils måsén 3 years ago committed by GitHub
parent d9d6f794a1
commit 782529ddbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -364,7 +364,10 @@ func runUpdatesWithNotifications(filter t.Filter) *metrics.Metric {
}
notifier.SendNotification(result)
metricResults := metrics.NewMetric(result)
log.Debugf("Session done: %v scanned, %v updated, %v failed",
metricResults.Scanned, metricResults.Updated, metricResults.Failed)
notifications.LocalLog.WithFields(log.Fields{
"Scanned": metricResults.Scanned,
"Updated": metricResults.Updated,
"Failed": metricResults.Failed,
}).Info("Session done")
return metricResults
}

@ -152,7 +152,7 @@ func (n *shoutrrrTypeNotifier) sendEntries(entries []*log.Entry, report t.Report
go func() {
if err != nil {
LocalLog.WithError(err).Fatal("Notification template error")
} else {
} else if len(n.Urls) > 1 {
LocalLog.Info("Skipping notification due to empty message")
}
}()

Loading…
Cancel
Save