Skip to content

Commit

Permalink
make logger behave as a logger
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Jan 26, 2018
1 parent be1313b commit 4812642
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion logger/standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ import (
type StandardLogger struct{}

func (StandardLogger) Printf(format string, args ...interface{}) {
fmt.Fprintf(os.Stdout, format, args...)
if len(format) == 0 || format[len(format)-1] != '\n' {
format += "\n"
}
fmt.Fprintf(os.Stderr, format, args...)
}

func (StandardLogger) Debugf(format string, args ...interface{}) {
if len(format) == 0 || format[len(format)-1] != '\n' {
format += "\n"
}
fmt.Fprintf(os.Stderr, format, args...)
}

0 comments on commit 4812642

Please sign in to comment.