logging

package
v0.46.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 3 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 interface {
	// DebugEnabled returns true if the debug level is enabled.
	DebugEnabled() bool

	// InfoEnabled returns true if the information level is enabled.
	InfoEnabled() bool

	// SetDebug sets/unsets the debug level for the logger
	SetDebug(b bool)

	// Debug sends to the log a debug message formatted using the fmt.Sprintf function and the
	// given format and arguments.
	Debug(args ...interface{})

	// Debugf sends to the log a debug message formatted using the fmt.Sprintf function and the
	// given format and arguments.
	Debugf(format string, args ...interface{})

	// Info sends to the log an information message formatted using the fmt.Sprintf function and
	// the given format and arguments.
	Info(args ...interface{})

	// Infof sends to the log an information message formatted using the fmt.Sprintf function and
	// the given format and arguments.
	Infof(format string, args ...interface{})

	// Error sends to the log an error message formatted using the fmt.Sprintln function and the
	// given format and arguments.
	Error(args ...interface{})

	// Errorf sends to the log an error message formatted using the fmt.Sprint function and the
	// given format and arguments.
	Errorf(format string, args ...interface{})
}

type StdLogger

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

StdLogger is a logger that uses the standard output and error streams, or custom writers.

func (*StdLogger) Debug

func (l *StdLogger) Debug(args ...interface{})

Debug sends to the log a debug message formatted using the fmt.Fprintln function and the given arguments.

func (*StdLogger) DebugEnabled

func (l *StdLogger) DebugEnabled() bool

DebugEnabled returns true iff the debug level is enabled.

func (*StdLogger) Debugf

func (l *StdLogger) Debugf(format string, args ...interface{})

Debugf sends to the log a debug message formatted using the fmt.Fprintf function and the given format and arguments.

func (*StdLogger) Error

func (l *StdLogger) Error(args ...interface{})

Error sends to the log an error message formatted using the fmt.Fprintln function and the given arguments.

func (*StdLogger) ErrorEnabled

func (l *StdLogger) ErrorEnabled() bool

ErrorEnabled returns true iff the error level is enabled.

func (*StdLogger) Errorf

func (l *StdLogger) Errorf(format string, args ...interface{})

Errorf sends to the log an error message formatted using the fmt.Fprintf function and the given format and arguments.

func (*StdLogger) Info

func (l *StdLogger) Info(args ...interface{})

Info sends to the log an information message formatted using the fmt.Fprintln function and the given arguments.

func (*StdLogger) InfoEnabled

func (l *StdLogger) InfoEnabled() bool

InfoEnabled returns true iff the information level is enabled.

func (*StdLogger) Infof

func (l *StdLogger) Infof(format string, args ...interface{})

Infof sends to the log an information message formatted using the fmt.Fprintf function and the given format and arguments.

func (*StdLogger) SetDebug

func (l *StdLogger) SetDebug(b bool)

SetDebug sets/unsets the debug level for the logger

type StdLoggerBuilder

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

StdLoggerBuilder contains the configuration and logic needed to build a logger that uses the standard output and error streams, or custom writers.

func NewStdLoggerBuilder

func NewStdLoggerBuilder() *StdLoggerBuilder

NewStdLoggerBuilder creates a builder that knows how to build a logger that uses the standard output and error streams, or custom writers. By default these loggers will have enabled the information, warning and error levels

func (*StdLoggerBuilder) Build

func (b *StdLoggerBuilder) Build() (logger *StdLogger, err error)

Build creates a new logger using the configuration stored in the builder.

func (*StdLoggerBuilder) Debug

func (b *StdLoggerBuilder) Debug(flag bool) *StdLoggerBuilder

Debug enables or disables the debug level.

func (*StdLoggerBuilder) Error

func (b *StdLoggerBuilder) Error(flag bool) *StdLoggerBuilder

Error enables or disables the error level.

func (*StdLoggerBuilder) Info

func (b *StdLoggerBuilder) Info(flag bool) *StdLoggerBuilder

Info enables or disables the information level.

func (*StdLoggerBuilder) Streams

func (b *StdLoggerBuilder) Streams(out io.Writer, err io.Writer) *StdLoggerBuilder

Streams sets the standard output and error streams to use. If not used then the logger will use os.Stdout and os.Stderr.

Jump to

Keyboard shortcuts

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