Skip to content

Commit b220f2c

Browse files
committed
add debug level test; add debug to interface
1 parent 5aaaaf0 commit b220f2c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

log/logger.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ type Logger interface {
44
Set(key string, value Valuer) Logger
55
With(ctxs ...Context) Logger
66

7+
Debug() Logger
78
Info() Logger
89
Warn() Logger
910
Error() Logger

log/logger_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ func Test_ReplaceContextValue(t *testing.T) {
166166
a.Contains(buffer.String(), "level=warn")
167167
}
168168

169+
func Test_Debug(t *testing.T) {
170+
a, buffer, log := Setup(t)
171+
172+
log.Debug().Logf("message")
173+
174+
a.Contains(buffer.String(), "level=debug")
175+
}
176+
169177
func Test_Info(t *testing.T) {
170178
a, buffer, log := Setup(t)
171179

0 commit comments

Comments
 (0)