The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/infra/log/interface.go

35 lines
850 B

package log
import "context"
type Lvl int
const (
LvlCrit Lvl = iota
LvlError
LvlWarn
LvlInfo
LvlDebug
)
type Logger interface {
// New returns a new contextual Logger that has this logger's context plus the given context.
New(ctx ...any) *ConcreteLogger
Log(keyvals ...any) error
// Debug logs a message with debug level and key/value pairs, if any.
Debug(msg string, ctx ...any)
// Info logs a message with info level and key/value pairs, if any.
Info(msg string, ctx ...any)
// Warn logs a message with warning level and key/value pairs, if any.
Warn(msg string, ctx ...any)
// Error logs a message with error level and key/value pairs, if any.
Error(msg string, ctx ...any)
// FromContext returns a new contextual Logger that has this logger's context plus the given context.
FromContext(ctx context.Context) Logger
}