clog

package
v0.0.0-...-0588a43 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleLogger

type ConsoleLogger struct {
	// contains filtered or unexported fields
}

ConsoleLogger is the struct used for mesh command

func NewConsoleLogger

func NewConsoleLogger(stdOut, stdErr io.Writer, scope *log.Scope) *ConsoleLogger

NewConsoleLogger creates a new logger and returns a pointer to it. stdOut and stdErr can be used to capture output for testing. If scope is nil, the default scope is used.

func NewDefaultLogger

func NewDefaultLogger() *ConsoleLogger

NewDefaultLogger creates a new logger that outputs to stdout/stderr at default scope.

func (*ConsoleLogger) LogAndError

func (l *ConsoleLogger) LogAndError(v ...any)

func (*ConsoleLogger) LogAndErrorf

func (l *ConsoleLogger) LogAndErrorf(format string, a ...any)

func (*ConsoleLogger) LogAndFatal

func (l *ConsoleLogger) LogAndFatal(a ...any)

func (*ConsoleLogger) LogAndFatalf

func (l *ConsoleLogger) LogAndFatalf(format string, a ...any)

func (*ConsoleLogger) LogAndPrint

func (l *ConsoleLogger) LogAndPrint(v ...any)

func (*ConsoleLogger) LogAndPrintf

func (l *ConsoleLogger) LogAndPrintf(format string, a ...any)

func (*ConsoleLogger) Print

func (l *ConsoleLogger) Print(s string)

func (*ConsoleLogger) PrintErr

func (l *ConsoleLogger) PrintErr(s string)

type Logger

type Logger interface {
	LogAndPrint(v ...any)
	LogAndError(v ...any)
	LogAndFatal(a ...any)
	LogAndPrintf(format string, a ...any)
	LogAndErrorf(format string, a ...any)
	LogAndFatalf(format string, a ...any)
	Print(s string)
	PrintErr(s string)
}

Logger provides optional log taps for console and test buffer outputs.

Jump to

Keyboard shortcuts

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