log

package
v0.0.0-...-fb7f86c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrettyLogger

func NewPrettyLogger(name string) *prettyLogger

Types

type Logger

type Logger interface {
	// New returns a new contextual Logger that has this logger's context plus the given context.
	New(ctx ...interface{}) Logger

	// Debug logs a message with debug level and key/value pairs, if any.
	Debug(msg string, ctx ...interface{})

	// Info logs a message with info level and key/value pairs, if any.
	Info(msg string, ctx ...interface{})

	// Warn logs a message with warning level and key/value pairs, if any.
	Warn(msg string, ctx ...interface{})

	// Error logs a message with error level and key/value pairs, if any.
	Error(msg string, ctx ...interface{})
}

Logger is the default logger

func New

func New(name string) Logger

type Logs

type Logs struct {
	Calls   int
	Message string
	Ctx     []interface{}
}

type PrettyLogger

type PrettyLogger interface {
	Successf(format string, args ...interface{})
	Failuref(format string, args ...interface{})

	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
}

PrettyLogger is used primarily to facilitate logging/user feedback for both the grafana-cli and the grafana backend when managing plugin installs

type TestLogger

type TestLogger struct {
	DebugLogs Logs
	InfoLogs  Logs
	WarnLogs  Logs
	ErrorLogs Logs
}

func NewTestLogger

func NewTestLogger() *TestLogger

func (*TestLogger) Debug

func (f *TestLogger) Debug(msg string, ctx ...interface{})

func (*TestLogger) Error

func (f *TestLogger) Error(msg string, ctx ...interface{})

func (*TestLogger) Info

func (f *TestLogger) Info(msg string, ctx ...interface{})

func (*TestLogger) New

func (f *TestLogger) New(_ ...interface{}) Logger

func (*TestLogger) Warn

func (f *TestLogger) Warn(msg string, ctx ...interface{})

type TestPrettyLogger

type TestPrettyLogger struct{}

func NewTestPrettyLogger

func NewTestPrettyLogger() *TestPrettyLogger

func (*TestPrettyLogger) Debug

func (f *TestPrettyLogger) Debug(_ ...interface{})

func (*TestPrettyLogger) Debugf

func (f *TestPrettyLogger) Debugf(_ string, _ ...interface{})

func (*TestPrettyLogger) Error

func (f *TestPrettyLogger) Error(_ ...interface{})

func (*TestPrettyLogger) Errorf

func (f *TestPrettyLogger) Errorf(_ string, _ ...interface{})

func (*TestPrettyLogger) Failuref

func (f *TestPrettyLogger) Failuref(_ string, _ ...interface{})

func (*TestPrettyLogger) Info

func (f *TestPrettyLogger) Info(_ ...interface{})

func (*TestPrettyLogger) Infof

func (f *TestPrettyLogger) Infof(_ string, _ ...interface{})

func (*TestPrettyLogger) Successf

func (f *TestPrettyLogger) Successf(_ string, _ ...interface{})

func (*TestPrettyLogger) Warn

func (f *TestPrettyLogger) Warn(_ ...interface{})

func (*TestPrettyLogger) Warnf

func (f *TestPrettyLogger) Warnf(_ string, _ ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL