Skip to content

Commit e9e1986

Browse files
author
Aaron Schlesinger
committed
fix(log.go): use internal debug switch
1 parent 8839df0 commit e9e1986

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

log/log.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Msg(format string, v ...interface{}) {
7373
// Die prints an error and then call os.Exit(1).
7474
func (l *Logger) Die(format string, v ...interface{}) {
7575
l.Err(format, v...)
76-
if IsDebugging {
76+
if l.debug {
7777
panic(fmt.Sprintf(format, v...))
7878
}
7979
os.Exit(1)
@@ -97,8 +97,8 @@ func CleanExit(format string, v ...interface{}) {
9797

9898
// Err prints an error message. It does not cause an exit.
9999
func (l *Logger) Err(format string, v ...interface{}) {
100-
fmt.Fprint(Stderr, addColor(ErrorPrefix+" ", Red))
101-
fmt.Fprintf(Stderr, appendNewLine(format), v...)
100+
fmt.Fprint(l.stderr, addColor(ErrorPrefix+" ", Red))
101+
fmt.Fprintf(l.stderr, appendNewLine(format), v...)
102102
}
103103

104104
// Err is a convenience function for DefaultLogger.Err(...)
@@ -117,7 +117,7 @@ func Info(format string, v ...interface{}) {
117117
DefaultLogger.Info(format, v...)
118118
}
119119

120-
// Debug prints a cyan-tinted message if IsDebugging is true.
120+
// Debug prints a cyan-tinted message if debug logs are on.
121121
func (l *Logger) Debug(msg string, v ...interface{}) {
122122
if l.debug {
123123
fmt.Fprint(l.stderr, addColor(DebugPrefix+" ", Cyan))

0 commit comments

Comments
 (0)