mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -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
58 lines
1.2 KiB
Go
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...))
|
|
}
|