Documentation ¶
Index ¶
- type ConsoleLogger
- func (l *ConsoleLogger) LogAndError(v ...any)
- func (l *ConsoleLogger) LogAndErrorf(format string, a ...any)
- func (l *ConsoleLogger) LogAndFatal(a ...any)
- func (l *ConsoleLogger) LogAndFatalf(format string, a ...any)
- func (l *ConsoleLogger) LogAndPrint(v ...any)
- func (l *ConsoleLogger) LogAndPrintf(format string, a ...any)
- func (l *ConsoleLogger) Print(s string)
- func (l *ConsoleLogger) PrintErr(s string)
- type Logger
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.
Click to show internal directories.
Click to hide internal directories.