fleet/server/logging/nanodep.go
Roberto Dip 4c4c114e96
add mocks + tests and move things around (#9574)
#8948

- Add more go:generate commands for MDM mocks
- Add unit and integration tests for MDM code
- Move interfaces from their PoC location to match existing patterns
2023-01-31 11:46:01 -03:00

34 lines
721 B
Go

package logging
import (
kitlog "github.com/go-kit/kit/log"
"github.com/go-kit/log/level"
nanodep_log "github.com/micromdm/nanodep/log"
)
// 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,
}
}