We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84c8d23 commit c165bb5Copy full SHA for c165bb5
log.go
@@ -473,8 +473,8 @@ func (l *slog) SetLevel(level Level) {
473
}
474
475
// Disabled is a Logger that will never output anything.
476
-var Disabled Logger
+var Disabled Logger = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)}
477
478
-func init() {
479
- Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)}
480
-}
+// TestLogger is a Logger intended for unit testing that will log all messages
+// to Stdout.
+var TestLogger Logger = &slog{lvl: LevelTrace, b: NewBackend(os.Stdout)}
0 commit comments