Documentation
¶
Index ¶
- func MtlogLevelToSlog(level core.LogEventLevel) slog.Level
- type LogrSink
- func (s *LogrSink) Enabled(level int) bool
- func (s *LogrSink) Error(err error, msg string, keysAndValues ...interface{})
- func (s *LogrSink) Info(level int, msg string, keysAndValues ...interface{})
- func (s *LogrSink) Init(info logr.RuntimeInfo)
- func (s *LogrSink) WithName(name string) logr.LogSink
- func (s *LogrSink) WithValues(keysAndValues ...interface{}) logr.LogSink
- type SlogHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MtlogLevelToSlog ¶
func MtlogLevelToSlog(level core.LogEventLevel) slog.Level
MtlogLevelToSlog converts mtlog levels to slog levels
Types ¶
type LogrSink ¶
type LogrSink struct {
// contains filtered or unexported fields
}
LogrSink implements logr.LogSink backed by mtlog's logger
func NewLogrSink ¶
NewLogrSink creates a new logr.LogSink that writes to the provided mtlog logger
func (*LogrSink) Init ¶
func (s *LogrSink) Init(info logr.RuntimeInfo)
Init receives optional information about the logr library
func (*LogrSink) WithValues ¶
WithValues returns a new LogSink with additional key/value pairs
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
SlogHandler implements slog.Handler backed by mtlog's logger
func NewSlogHandler ¶
func NewSlogHandler(logger core.Logger) *SlogHandler
NewSlogHandler creates a new slog.Handler that writes to the provided mtlog logger
func (*SlogHandler) Enabled ¶
Enabled reports whether the handler handles records at the given level
Click to show internal directories.
Click to hide internal directories.