Skip to content

Commit

Permalink
simplify simple log format
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Teng <[email protected]>
  • Loading branch information
edtenz committed Sep 5, 2021
1 parent 12818c7 commit 1869bb8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion core/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func (sf *SimpleFormatter) Format(entry *LogEntry) *bufferpool.Buffer {
buf.AppendByte('\t')

// msg
buf.AppendString("|msg:=")
buf.AppendValue(entry.Msg)

if entry.Err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestSimpleFormatter_Format(t *testing.T) {
}
got := formatter.Format(meta)
t.Log(got)
expect := "2021-06-15 12:20:45 [INFO]\t|msg:=hello world\t|err:=oops\t|fields:={\"rootCause\":\"nil pointer\"}\n"
expect := "2021-06-15 12:20:45 [INFO]\thello world\t|err:=oops\t|fields:={\"rootCause\":\"nil pointer\"}\n"
if got.String() != expect {
t.Errorf("got: %s, expected: %s", got, expect)
}
Expand Down

0 comments on commit 1869bb8

Please sign in to comment.