mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
26 lines
466 B
Go
26 lines
466 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 ...any) error {
|
|
for _, logger := range l.loggers {
|
|
if err := logger.Log(keyvals...); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|