2023-01-31 14:46:01 +00:00
|
|
|
package logging
|
|
|
|
|
|
|
|
import (
|
2024-02-26 15:26:00 +00:00
|
|
|
nanodep_log "github.com/fleetdm/fleet/v4/server/mdm/nanodep/log"
|
2023-01-31 14:46:01 +00:00
|
|
|
kitlog "github.com/go-kit/kit/log"
|
|
|
|
"github.com/go-kit/log/level"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NanoDEPLogger is a logger adapter for nanodep.
|
|
|
|
type NanoDEPLogger struct {
|
|
|
|
logger kitlog.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNanoDEPLogger(logger kitlog.Logger) *NanoDEPLogger {
|
|
|
|
return &NanoDEPLogger{
|
|
|
|
logger: logger,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *NanoDEPLogger) Info(keyvals ...interface{}) {
|
|
|
|
level.Info(l.logger).Log(keyvals...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *NanoDEPLogger) Debug(keyvals ...interface{}) {
|
|
|
|
level.Debug(l.logger).Log(keyvals...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *NanoDEPLogger) With(keyvals ...interface{}) nanodep_log.Logger {
|
|
|
|
newLogger := kitlog.With(l.logger, keyvals...)
|
|
|
|
return &NanoDEPLogger{
|
|
|
|
logger: newLogger,
|
|
|
|
}
|
|
|
|
}
|