mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
26 lines
619 B
Go
26 lines
619 B
Go
package table
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/rs/zerolog"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
// Logger is a wrapper around zerolog, which we use for tables
|
|
// using the go-kit logger
|
|
type Logger struct {
|
|
zerolog.Logger
|
|
}
|
|
|
|
// Log logs a message, implementing log.Logger interface
|
|
func (l *Logger) Log(keyValuePairs ...interface{}) error {
|
|
log.Logger.Info().Msg(fmt.Sprint(keyValuePairs...))
|
|
return nil
|
|
}
|
|
|
|
// NewOsqueryLogger returns the Logger struct.
|
|
func NewOsqueryLogger() *Logger {
|
|
// Return a Logger struct with our global logger, and use the existing global config for the log level.
|
|
return &Logger{log.Logger}
|
|
}
|