diff --git a/util/logstash/log.go b/util/logstash/log.go index 4e434f073..ed555b099 100644 --- a/util/logstash/log.go +++ b/util/logstash/log.go @@ -105,10 +105,10 @@ func (l *logger) All(areas []string, level jww.Threshold, count int) []string { res := make([]string, 0, r.Len()) for range r.Len() { - r = r.Next() if e, ok := r.Value.(element); ok && e != "" && (all || e.match(areas, level)) { res = append(res, string(e)) } + r = r.Next() } if count > 0 && len(res) > count { diff --git a/util/logstash/log_test.go b/util/logstash/log_test.go index 53193e022..31caad9e9 100644 --- a/util/logstash/log_test.go +++ b/util/logstash/log_test.go @@ -14,7 +14,7 @@ var ( ) func TestLog(t *testing.T) { - log := New(10) + log := New(3) // old to new log.Write([]byte(s1))