mirror of
https://github.com/grafana/grafana.git
synced 2025-01-19 13:03:32 -06:00
c39d6ad97d
* add uninstall flow * add install flow * small cleanup * smaller-footprint solution * cleanup + make bp start auto * fix interface contract * improve naming * accept version arg * ensure use of shared logger * make installer a field * add plugin decommissioning * add basic error checking * fix api docs * making initialization idempotent * add mutex * fix comment * fix test * add test for decommission * improve existing test * add more test coverage * more tests * change test func to use read lock * refactoring + adding test asserts * improve purging old install flow * improve dupe checking * change log name * skip over dupe scanned * make test assertion more flexible * remove trailing line * fix pointer receiver name * update comment * add context to API * add config flag * add base http api test + fix update functionality * simplify existing check * clean up test * refactor tests based on feedback * add single quotes to errs * use gcmp in tests + fix logo issue * make plugin list testing more flexible * address feedback * fix API test * fix linter * undo preallocate * Update docs/sources/administration/configuration.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/administration/configuration.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/administration/configuration.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * fix linting issue in test * add docs placeholder * update install notes * Update docs/sources/plugins/marketplace.md Co-authored-by: Marcus Olsson <marcus.olsson@hey.com> * update access wording * add more placeholder docs * add link to more info * PR feedback - improved errors, refactor, lock fix * improve err details * propagate plugin version errors * don't autostart renderer * add H1 * fix imports Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>
65 lines
1.4 KiB
Go
65 lines
1.4 KiB
Go
package manager
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
)
|
|
|
|
type InfraLogWrapper struct {
|
|
l log.Logger
|
|
|
|
debugMode bool
|
|
}
|
|
|
|
func NewInstallerLogger(name string, debugMode bool) (l *InfraLogWrapper) {
|
|
return &InfraLogWrapper{
|
|
debugMode: debugMode,
|
|
l: log.New(name),
|
|
}
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Successf(format string, args ...interface{}) {
|
|
l.l.Info(fmt.Sprintf(format, args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Failuref(format string, args ...interface{}) {
|
|
l.l.Error(fmt.Sprintf(format, args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Info(args ...interface{}) {
|
|
l.l.Info(fmt.Sprint(args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Infof(format string, args ...interface{}) {
|
|
l.l.Info(fmt.Sprintf(format, args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Debug(args ...interface{}) {
|
|
if l.debugMode {
|
|
l.l.Debug(fmt.Sprint(args...))
|
|
}
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Debugf(format string, args ...interface{}) {
|
|
if l.debugMode {
|
|
l.l.Debug(fmt.Sprintf(format, args...))
|
|
}
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Warn(args ...interface{}) {
|
|
l.l.Warn(fmt.Sprint(args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Warnf(format string, args ...interface{}) {
|
|
l.l.Warn(fmt.Sprintf(format, args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Error(args ...interface{}) {
|
|
l.l.Error(fmt.Sprint(args...))
|
|
}
|
|
|
|
func (l *InfraLogWrapper) Errorf(format string, args ...interface{}) {
|
|
l.l.Error(fmt.Sprintf(format, args...))
|
|
}
|