Skip to content

Commit a23f49f

Browse files
committed
Do not send an email notification when no messages have been logged.
1 parent 4c63746 commit a23f49f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notifications/email.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ func (e *emailTypeNotifier) StartNotification() {
8787
}
8888

8989
func (e *emailTypeNotifier) SendNotification() {
90-
if e.entries != nil {
90+
if e.entries != nil && len(e.entries) != 0 {
9191
e.sendEntries(e.entries)
92-
e.entries = nil
9392
}
93+
e.entries = nil
9494
}
9595

9696
func (e *emailTypeNotifier) Levels() []log.Level {

0 commit comments

Comments
 (0)