From a23f49f4442b774c0f7eccfc7faa2624c5305aad Mon Sep 17 00:00:00 2001 From: Fabrizio Steiner Date: Mon, 1 Jan 2018 09:34:53 +0100 Subject: [PATCH] Do not send an email notification when no messages have been logged. --- notifications/email.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications/email.go b/notifications/email.go index 9fd8774..075aae4 100644 --- a/notifications/email.go +++ b/notifications/email.go @@ -87,10 +87,10 @@ func (e *emailTypeNotifier) StartNotification() { } func (e *emailTypeNotifier) SendNotification() { - if e.entries != nil { + if e.entries != nil && len(e.entries) != 0 { e.sendEntries(e.entries) - e.entries = nil } + e.entries = nil } func (e *emailTypeNotifier) Levels() []log.Level {