grafana/pkg/plugins/logger/logger.go
Will Browne d0d8544ded
Plugins: Create single point of entry for adding / removing plugins (#55463)
* split out plugin manager

* remove whitespace

* fix tests

* split up tests

* updating naming conventions

* simplify manager

* tidy

* explorations

* fix build

* tidy

* fix tests

* add logger helper

* pass the tests

* tidying

* fix tests

* tidy and re-add test

* store depends on loader

* enrich tests

* fix test

* undo gomod changes
2022-09-23 14:27:01 +02:00

58 lines
1.3 KiB
Go

package logger
import (
"fmt"
"github.com/grafana/grafana/pkg/infra/log"
)
type InfraLogWrapper struct {
log log.Logger
}
func NewLogger(name string) *InfraLogWrapper {
return &InfraLogWrapper{
log: log.New(name),
}
}
func (l *InfraLogWrapper) Successf(format string, args ...interface{}) {
l.log.Info(fmt.Sprintf(format, args...))
}
func (l *InfraLogWrapper) Failuref(format string, args ...interface{}) {
l.log.Error(fmt.Sprintf(format, args...))
}
func (l *InfraLogWrapper) Info(args ...interface{}) {
l.log.Info(fmt.Sprint(args...))
}
func (l *InfraLogWrapper) Infof(format string, args ...interface{}) {
l.log.Info(fmt.Sprintf(format, args...))
}
func (l *InfraLogWrapper) Debug(args ...interface{}) {
l.log.Debug(fmt.Sprint(args...))
}
func (l *InfraLogWrapper) Debugf(format string, args ...interface{}) {
l.log.Debug(fmt.Sprintf(format, args...))
}
func (l *InfraLogWrapper) Warn(args ...interface{}) {
l.log.Warn(fmt.Sprint(args...))
}
func (l *InfraLogWrapper) Warnf(format string, args ...interface{}) {
l.log.Warn(fmt.Sprintf(format, args...))
}
func (l *InfraLogWrapper) Error(args ...interface{}) {
l.log.Error(fmt.Sprint(args...))
}
func (l *InfraLogWrapper) Errorf(format string, args ...interface{}) {
l.log.Error(fmt.Sprintf(format, args...))
}