Documentation ¶
Overview ¶
Package log provides a logging interface to send logs from plugins to Grafana server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = New()
DefaultLogger is the default logger.
Functions ¶
func ContextualAttributesFromContext ¶
ContextualAttributesFromContext returns the contextual key/value log parameters from the given context. If no contextual log parameters are set, it returns nil.
func WithContextualAttributes ¶
WithContextualAttributes returns a new context with the given key/value log parameters appended to the existing ones. It's possible to get a logger with those contextual parameters by using [FromContext].
Types ¶
type Logger ¶
type Logger interface { Debug(msg string, args ...interface{}) Info(msg string, args ...interface{}) Warn(msg string, args ...interface{}) Error(msg string, args ...interface{}) With(args ...interface{}) Logger Level() Level FromContext(ctx context.Context) Logger }
Logger is the main Logger interface.
func NewNullLogger ¶
func NewNullLogger() Logger
NewNullLogger returns a logger that does nothing, for testing purposes
func NewWithLevel ¶
NewWithLevel creates a new logger at the Level defined.
Click to show internal directories.
Click to hide internal directories.