Skip to content

Commit f0655c5

Browse files
authored
Merge pull request #31 from aybabtme/fix-time-parsing
parse time using supported time fields, not level fields...
2 parents a97d727 + 450ea4a commit f0655c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

json_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (h *JSONHandler) UnmarshalJSON(data []byte) bool {
7575
return false
7676
}
7777

78-
checkEachUntilFound(supportedLevelFields, func(field string) bool {
78+
checkEachUntilFound(supportedTimeFields, func(field string) bool {
7979
time, ok := tryParseTime(raw[field])
8080
if ok {
8181
h.Time = time

logfmt_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (h *LogfmtHandler) UnmarshalLogfmt(data []byte) bool {
6262
key := dec.Key()
6363
val := dec.Value()
6464
if h.Time.IsZero() {
65-
foundTime := checkEachUntilFound(supportedLevelFields, func(field string) bool {
65+
foundTime := checkEachUntilFound(supportedTimeFields, func(field string) bool {
6666
time, ok := tryParseTime(string(val))
6767
if ok {
6868
h.Time = time

0 commit comments

Comments
 (0)