poet

package
v1.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 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 Logger

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

Logger logs messages to a writer.

func NewLogger

func NewLogger(writer io.Writer) Logger

NewLogger creates a new instance of Logger. It configures debug logging if $BP_DEBUG is set.

func NewLoggerWithOptions

func NewLoggerWithOptions(writer io.Writer, options ...Option) Logger

NewLoggerWithOptions create a new instance of Logger. It configures the Logger with options.

func (Logger) Debug

func (l Logger) Debug(a ...interface{})

Debug formats using the default formats for its operands and writes to the configured debug writer. Spaces are added between operands when neither is a string.

func (Logger) DebugWriter

func (l Logger) DebugWriter() io.Writer

DebugWriter returns the configured debug writer.

func (Logger) Debugf added in v1.6.0

func (l Logger) Debugf(format string, a ...interface{})

Debugf formats according to a format specifier and writes to the configured debug writer.

func (Logger) Info

func (l Logger) Info(a ...interface{})

Info formats using the default formats for its operands and writes to the configured info writer. Spaces are added between operands when neither is a string.

func (Logger) InfoWriter

func (l Logger) InfoWriter() io.Writer

InfoWriter returns the configured info writer.

func (Logger) Infof added in v1.6.0

func (l Logger) Infof(format string, a ...interface{})

Infof formats according to a format specifier and writes to the configured info writer.

func (Logger) IsDebugEnabled

func (l Logger) IsDebugEnabled() bool

IsDebugEnabled indicates whether debug logging is enabled.

func (Logger) IsInfoEnabled

func (l Logger) IsInfoEnabled() bool

IsInfoEnabled indicates whether info logging is enabled.

type Option

type Option func(Logger) Logger

Option is a function that configures a Logger.

func LogLevel added in v1.23.0

func LogLevel(options []Option, writer io.Writer) []Option

func WithDebug

func WithDebug(writer io.Writer) Option

WithDebug configures the debug Writer.

Jump to

Keyboard shortcuts

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