replace dep with go modules (#16017)
- guide shamelessly stolen from prometheus/prometheus - updates local interface of oauth exchange - updates local impl of hclogger - bump jaeger client version closes #16088
This commit is contained in:
+10
-10
@@ -9,12 +9,12 @@ import (
|
||||
// and back into our Logger. This is basically the only way to
|
||||
// build upon *log.Logger.
|
||||
type stdlogAdapter struct {
|
||||
hl Logger
|
||||
log Logger
|
||||
inferLevels bool
|
||||
}
|
||||
|
||||
// Take the data, infer the levels if configured, and send it through
|
||||
// a regular Logger
|
||||
// a regular Logger.
|
||||
func (s *stdlogAdapter) Write(data []byte) (int, error) {
|
||||
str := string(bytes.TrimRight(data, " \t\n"))
|
||||
|
||||
@@ -22,26 +22,26 @@ func (s *stdlogAdapter) Write(data []byte) (int, error) {
|
||||
level, str := s.pickLevel(str)
|
||||
switch level {
|
||||
case Trace:
|
||||
s.hl.Trace(str)
|
||||
s.log.Trace(str)
|
||||
case Debug:
|
||||
s.hl.Debug(str)
|
||||
s.log.Debug(str)
|
||||
case Info:
|
||||
s.hl.Info(str)
|
||||
s.log.Info(str)
|
||||
case Warn:
|
||||
s.hl.Warn(str)
|
||||
s.log.Warn(str)
|
||||
case Error:
|
||||
s.hl.Error(str)
|
||||
s.log.Error(str)
|
||||
default:
|
||||
s.hl.Info(str)
|
||||
s.log.Info(str)
|
||||
}
|
||||
} else {
|
||||
s.hl.Info(str)
|
||||
s.log.Info(str)
|
||||
}
|
||||
|
||||
return len(data), nil
|
||||
}
|
||||
|
||||
// Detect, based on conventions, what log level this is
|
||||
// Detect, based on conventions, what log level this is.
|
||||
func (s *stdlogAdapter) pickLevel(str string) (Level, string) {
|
||||
switch {
|
||||
case strings.HasPrefix(str, "[DEBUG]"):
|
||||
|
||||
Reference in New Issue
Block a user