diff --git a/ctx.go b/ctx.go index 2b7a6823..19027639 100644 --- a/ctx.go +++ b/ctx.go @@ -4,11 +4,11 @@ import ( "context" ) -var disabledLogger *Logger +var DefaultLogger *Logger func init() { l := Nop() - disabledLogger = &l + DefaultLogger = &l } type ctxKey struct{} @@ -43,5 +43,5 @@ func Ctx(ctx context.Context) *Logger { if l, ok := ctx.Value(ctxKey{}).(*Logger); ok { return l } - return disabledLogger + return DefaultLogger } diff --git a/ctx_test.go b/ctx_test.go index 646cd0fb..1559af2f 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -24,7 +24,7 @@ func TestCtx(t *testing.T) { } log2 = Ctx(context.Background()) - if log2 != disabledLogger { + if log2 != DefaultLogger { t.Error("Ctx did not return the expected logger") } } diff --git a/log.go b/log.go index da64b8a3..7be322c4 100644 --- a/log.go +++ b/log.go @@ -235,7 +235,7 @@ func (l Logger) With() Context { // // Use this method with caution. If unsure, prefer the With method. func (l *Logger) UpdateContext(update func(c Context) Context) { - if l == disabledLogger { + if l == DefaultLogger { return } if cap(l.context) == 0 {