Skip to content

Commit

Permalink
Merge pull request #24 from bettio/can-handle-should-handle-aliases
Browse files Browse the repository at this point in the history
Accept short aliases such as ts for timestamp
  • Loading branch information
aybabtme authored Jun 14, 2019
2 parents 54cd1ed + 9b6d86d commit 5b53c97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions logrus_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ func (h *LogrusHandler) clear() {

// CanHandle tells if this line can be handled by this handler.
func (h *LogrusHandler) CanHandle(d []byte) bool {
if !bytes.Contains(d, []byte(`level=`)) {
if !(bytes.Contains(d, []byte(`level=`)) || bytes.Contains(d, []byte(`lvl=`))) {
return false
}
if !bytes.Contains(d, []byte(`time="`)) {
if !(bytes.Contains(d, []byte(`time=`)) || bytes.Contains(d, []byte(`ts=`))) {
return false
}
if !bytes.Contains(d, []byte(`msg="`)) {
if !(bytes.Contains(d, []byte(`message=`)) || bytes.Contains(d, []byte(`msg=`))) {
return false
}
return true
Expand Down

0 comments on commit 5b53c97

Please sign in to comment.