Skip to content

Commit 5fd9351

Browse files
author
Aaron Schlesinger
committed
fix(log.go): remove global stdout/debug vars
the initialization order made it impossible to configure the default logger before it was created
1 parent e8fdf6e commit 5fd9351

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

log/log.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ import (
1010
"github.com/deis/pkg/prettyprint"
1111
)
1212

13-
// Stdout is the logging destination for normal messages.
14-
var Stdout io.Writer = os.Stdout
15-
16-
// Stderr is the logging destination for error messages.
17-
var Stderr io.Writer = os.Stderr
18-
19-
// IsDebugging toggles whether or not to enable debug output and behavior.
20-
var IsDebugging = false
21-
2213
// Color is the representation of a color, to be used in Colorize
2314
type Color string
2415

@@ -60,7 +51,7 @@ func NewLogger(stdout, stderr io.Writer, debug bool) *Logger {
6051
}
6152

6253
// DefaultLogger is the default logging implementation. It's used in all top level funcs inside the log package, and represents the equivalent of NewLogger(os.Stdout, os.Stderr)
63-
var DefaultLogger *Logger
54+
var DefaultLogger = &Logger{stdout: os.Stdout, stderr: os.Stderr, debug: false}
6455

6556
func init() {
6657
DefaultLogger = &Logger{stdout: Stdout, stderr: Stderr, debug: IsDebugging}

0 commit comments

Comments
 (0)