Skip to content

Commit

Permalink
fixup! Add a test for post-SetLevel .Named()
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmi committed Dec 12, 2023
1 parent 2eb96de commit 151e031
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ func TestLogger(t *testing.T) {
Output: &buf,
})

logger.Info("this is test", "bytes", Hex(12), "perms", Octal(0o755), "bits", Binary(5))
logger.Info("this is test", "bytes", Hex(12), "perms", Octal(0755), "bits", Binary(5))

str := buf.String()
dataIdx := strings.IndexByte(str, ' ')
Expand Down Expand Up @@ -1079,7 +1079,7 @@ func TestLogger_JSON(t *testing.T) {
JSONFormat: true,
})

logger.Info("this is test", "bytes", Hex(12), "perms", Octal(0o755), "bits", Binary(5))
logger.Info("this is test", "bytes", Hex(12), "perms", Octal(0755), "bits", Binary(5))

b := buf.Bytes()

Expand All @@ -1090,7 +1090,7 @@ func TestLogger_JSON(t *testing.T) {

assert.Equal(t, "this is test", raw["@message"])
assert.Equal(t, float64(12), raw["bytes"])
assert.Equal(t, float64(0o755), raw["perms"])
assert.Equal(t, float64(0755), raw["perms"])
assert.Equal(t, float64(5), raw["bits"])
})

Expand Down Expand Up @@ -1231,6 +1231,7 @@ func TestLogger_JSON(t *testing.T) {

assert.Equal(t, "[INFO] test: who=programmer why=testing\n", rest)
})

}

type customErrJSON struct {
Expand Down

0 comments on commit 151e031

Please sign in to comment.