Skip to content

Commit

Permalink
the new logfmt parser is too eager to accept any input as valid logfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme committed Dec 10, 2019
1 parent 8cfbf17 commit 3b32c27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logfmt_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func (h *LogfmtHandler) clear() {

// CanHandle tells if this line can be handled by this handler.
func (h *LogfmtHandler) TryHandle(d []byte) bool {
if !bytes.ContainsRune(d, '=') {
return false
}

if !h.UnmarshalLogfmt(d) {
h.clear()
return false
Expand Down

0 comments on commit 3b32c27

Please sign in to comment.