mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
26 lines
474 B
Go
26 lines
474 B
Go
package log
|
|
|
|
import gokitlog "github.com/go-kit/log"
|
|
|
|
type compositeLogger struct {
|
|
loggers []gokitlog.Logger
|
|
}
|
|
|
|
func newCompositeLogger(loggers ...gokitlog.Logger) *compositeLogger {
|
|
if len(loggers) == 0 {
|
|
loggers = []gokitlog.Logger{}
|
|
}
|
|
|
|
return &compositeLogger{loggers: loggers}
|
|
}
|
|
|
|
func (l *compositeLogger) Log(keyvals ...interface{}) error {
|
|
for _, logger := range l.loggers {
|
|
if err := logger.Log(keyvals...); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|