From b69b9b04da90baf001063fc0c8762e0ee4e3ba6d Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 5 Dec 2017 17:20:24 +0100 Subject: [PATCH] Add TestLogger for testing purposes --- log.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/log.go b/log.go index d8f3dcd..c263a6f 100644 --- a/log.go +++ b/log.go @@ -473,8 +473,8 @@ func (l *slog) SetLevel(level Level) { } // Disabled is a Logger that will never output anything. -var Disabled Logger +var Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)} -func init() { - Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)} -} +// TestLogger is a Logger intended for unit testing that will log all messages +// to Stdout. +var TestLogger = &slog{lvl: LevelTrace, b: NewBackend(os.Stdout)}