Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a type which may be used to write logs to a console.
func (*Logger) Print ¶
func (l *Logger) Print(output string, opts ...PrintOption) error
Print prints a line of output to the console.
func (*Logger) WithPrefix ¶
WithPrefix returns a new Logger with pfx added. Any existing prefix in l will be prepended.
type PrintOption ¶ added in v0.7.0
type PrintOption func(printPrefs) printPrefs
func AsVerbose ¶ added in v0.7.0
func AsVerbose() PrintOption
AsVerbose marks the message as a verbose message, only printing if the console logger is in verbose mode.
func Fmt ¶ added in v0.7.0
func Fmt(args ...any) PrintOption
Fmt adds format args to the print statement.
func NewlinePfx ¶ added in v0.7.0
func NewlinePfx() PrintOption
NewlinePfx changes the message to _start_ with a newline, rather than end with one. Loggers usually end every message with a newline. This moves the newline to the start.
func Once ¶ added in v0.7.0
func Once() PrintOption
Once ensures that this message is only printed once. This is useful for messages that might get repeated by multiple goroutines.