2023-02-28 09:10:27 -06:00
|
|
|
package log
|
|
|
|
|
2023-10-11 05:42:32 -05:00
|
|
|
import "context"
|
|
|
|
|
2023-02-28 09:10:27 -06:00
|
|
|
// Logger is the default logger
|
|
|
|
type Logger interface {
|
|
|
|
// New returns a new contextual Logger that has this logger's context plus the given context.
|
2023-10-11 05:42:32 -05:00
|
|
|
New(ctx ...any) Logger
|
2023-02-28 09:10:27 -06:00
|
|
|
|
|
|
|
// Debug logs a message with debug level and key/value pairs, if any.
|
2023-10-11 05:42:32 -05:00
|
|
|
Debug(msg string, ctx ...any)
|
2023-02-28 09:10:27 -06:00
|
|
|
|
|
|
|
// Info logs a message with info level and key/value pairs, if any.
|
2023-10-11 05:42:32 -05:00
|
|
|
Info(msg string, ctx ...any)
|
2023-02-28 09:10:27 -06:00
|
|
|
|
|
|
|
// Warn logs a message with warning level and key/value pairs, if any.
|
2023-10-11 05:42:32 -05:00
|
|
|
Warn(msg string, ctx ...any)
|
2023-02-28 09:10:27 -06:00
|
|
|
|
|
|
|
// Error logs a message with error level and key/value pairs, if any.
|
2023-10-11 05:42:32 -05:00
|
|
|
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
|
2023-02-28 09:10:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// PrettyLogger is used primarily to facilitate logging/user feedback for both
|
|
|
|
// the grafana-cli and the grafana backend when managing plugin installs
|
|
|
|
type PrettyLogger interface {
|
2023-10-11 05:42:32 -05:00
|
|
|
Successf(format string, args ...any)
|
|
|
|
Failuref(format string, args ...any)
|
|
|
|
|
|
|
|
Info(args ...any)
|
|
|
|
Infof(format string, args ...any)
|
|
|
|
Debug(args ...any)
|
|
|
|
Debugf(format string, args ...any)
|
|
|
|
Warn(args ...any)
|
|
|
|
Warnf(format string, args ...any)
|
|
|
|
Error(args ...any)
|
|
|
|
Errorf(format string, args ...any)
|
2023-02-28 09:10:27 -06:00
|
|
|
}
|