log

package
v0.0.0-cloud Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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{})

Jump to

Keyboard shortcuts

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