grafana/pkg/plugins/log/infra_wrapper.go
Will Browne ec82719372
Plugins: Introduce plugin package specific logger (#62204)
* refactor

* implement with infra log for now

* undo moving

* update package name

* update name

* fix tests

* update pretty signature

* update naming

* simplify

* fix typo

* delete comment

* fix import

* retrigger
2023-02-28 16:10:27 +01:00

58 lines
1.2 KiB
Go

package log
import (
"fmt"
)
var _ PrettyLogger = (*prettyLogger)(nil)
type prettyLogger struct {
log Logger
}
func NewPrettyLogger(name string) *prettyLogger {
return &prettyLogger{
log: New(name),
}
}
func (l *prettyLogger) Successf(format string, args ...interface{}) {
l.log.Info(fmt.Sprintf(format, args...))
}
func (l *prettyLogger) Failuref(format string, args ...interface{}) {
l.log.Error(fmt.Sprintf(format, args...))
}
func (l *prettyLogger) Info(args ...interface{}) {
l.log.Info(fmt.Sprint(args...))
}
func (l *prettyLogger) Infof(format string, args ...interface{}) {
l.log.Info(fmt.Sprintf(format, args...))
}
func (l *prettyLogger) Debug(args ...interface{}) {
l.log.Debug(fmt.Sprint(args...))
}
func (l *prettyLogger) Debugf(format string, args ...interface{}) {
l.log.Debug(fmt.Sprintf(format, args...))
}
func (l *prettyLogger) Warn(args ...interface{}) {
l.log.Warn(fmt.Sprint(args...))
}
func (l *prettyLogger) Warnf(format string, args ...interface{}) {
l.log.Warn(fmt.Sprintf(format, args...))
}
func (l *prettyLogger) Error(args ...interface{}) {
l.log.Error(fmt.Sprint(args...))
}
func (l *prettyLogger) Errorf(format string, args ...interface{}) {
l.log.Error(fmt.Sprintf(format, args...))
}