mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
ec82719372
* 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
45 lines
870 B
Go
45 lines
870 B
Go
package log
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
)
|
|
|
|
func New(name string) Logger {
|
|
return &grafanaInfraLogWrapper{
|
|
l: log.New(name),
|
|
}
|
|
}
|
|
|
|
type grafanaInfraLogWrapper struct {
|
|
l *log.ConcreteLogger
|
|
}
|
|
|
|
func (d *grafanaInfraLogWrapper) New(ctx ...interface{}) Logger {
|
|
if len(ctx) == 0 {
|
|
return &grafanaInfraLogWrapper{
|
|
l: d.l.New(),
|
|
}
|
|
}
|
|
|
|
ctx = append([]interface{}{"logger"}, ctx...)
|
|
return &grafanaInfraLogWrapper{
|
|
l: d.l.New(ctx...),
|
|
}
|
|
}
|
|
|
|
func (d *grafanaInfraLogWrapper) Debug(msg string, ctx ...interface{}) {
|
|
d.l.Debug(msg, ctx...)
|
|
}
|
|
|
|
func (d *grafanaInfraLogWrapper) Info(msg string, ctx ...interface{}) {
|
|
d.l.Info(msg, ctx...)
|
|
}
|
|
|
|
func (d *grafanaInfraLogWrapper) Warn(msg string, ctx ...interface{}) {
|
|
d.l.Warn(msg, ctx...)
|
|
}
|
|
|
|
func (d *grafanaInfraLogWrapper) Error(msg string, ctx ...interface{}) {
|
|
d.l.Error(msg, ctx...)
|
|
}
|