Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
codecs : line encoder - fix crash when given format option is ""
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeantet committed Jan 11, 2018
1 parent b4a2f5c commit 27be9d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codecs/line/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func NewEncoder(w io.Writer) *encoder {
Format: `{{ TS "dd/MM/yyyy:HH:mm:ss" . }} {{.host}} {{.message}}`,
},
}
loc, _ := commons.NewLocation(e.options.Format, "")
e.formatTpl, _, _ = loc.TemplateWithOptions(e.options.Var)

return e
}
Expand Down

0 comments on commit 27be9d0

Please sign in to comment.