-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #864 from github/logging-interface-contrib
Logging interface contrib
- Loading branch information
Showing
11 changed files
with
320 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package base | ||
|
||
import ( | ||
"github.com/outbrain/golib/log" | ||
) | ||
|
||
type simpleLogger struct{} | ||
|
||
func NewDefaultLogger() *simpleLogger { | ||
return &simpleLogger{} | ||
} | ||
|
||
func (*simpleLogger) Debug(args ...interface{}) { | ||
log.Debug(args[0].(string), args[1:]) | ||
return | ||
} | ||
|
||
func (*simpleLogger) Debugf(format string, args ...interface{}) { | ||
log.Debugf(format, args...) | ||
return | ||
} | ||
|
||
func (*simpleLogger) Info(args ...interface{}) { | ||
log.Info(args[0].(string), args[1:]) | ||
return | ||
} | ||
|
||
func (*simpleLogger) Infof(format string, args ...interface{}) { | ||
log.Infof(format, args...) | ||
return | ||
} | ||
|
||
func (*simpleLogger) Warning(args ...interface{}) error { | ||
return log.Warning(args[0].(string), args[1:]) | ||
} | ||
|
||
func (*simpleLogger) Warningf(format string, args ...interface{}) error { | ||
return log.Warningf(format, args...) | ||
} | ||
|
||
func (*simpleLogger) Error(args ...interface{}) error { | ||
return log.Error(args[0].(string), args[1:]) | ||
} | ||
|
||
func (*simpleLogger) Errorf(format string, args ...interface{}) error { | ||
return log.Errorf(format, args...) | ||
} | ||
|
||
func (*simpleLogger) Errore(err error) error { | ||
return log.Errore(err) | ||
} | ||
|
||
func (*simpleLogger) Fatal(args ...interface{}) error { | ||
return log.Fatal(args[0].(string), args[1:]) | ||
} | ||
|
||
func (*simpleLogger) Fatalf(format string, args ...interface{}) error { | ||
return log.Fatalf(format, args...) | ||
} | ||
|
||
func (*simpleLogger) Fatale(err error) error { | ||
return log.Fatale(err) | ||
} | ||
|
||
func (*simpleLogger) SetLevel(level log.LogLevel) { | ||
log.SetLevel(level) | ||
return | ||
} | ||
|
||
func (*simpleLogger) SetPrintStackTrace(printStackTraceFlag bool) { | ||
log.SetPrintStackTrace(printStackTraceFlag) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.