logging

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 51

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

	// Info prints an formatted output message
	// using fmt.Fprint function
	Info(args ...interface{})

	// Error prints an formatted error message
	// using fmt.Fprint function
	Error(args ...interface{})

	// Infof prints an formatted output message
	// using fmt.Fprintf function
	Infof(format string, args ...interface{})

	// Errorf prints an formatted error message
	// using fmt.Fprintf function
	Errorf(format string, args ...interface{})

	// Infoln prints an formatted output message
	// using fmt.Fprintln function
	Infoln(args ...interface{})

	// Errorln prints an formatted error message
	// using fmt.Fprintln function
	Errorln(args ...interface{})
}

Logger is an Interface for logging messages in unified way

type StdLogger

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

StdLogger is a type of logger which uses standard output and error streams, or custom writers

func (*StdLogger) DebugEnabled

func (l *StdLogger) DebugEnabled() bool

DebugEnabled returns true iff the debug level is enabled.

func (*StdLogger) Error

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

Error prints an formatted error message using fmt.Fprint function

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 prints an formatted error message using fmt.Fprintf function

func (*StdLogger) Errorln

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

Errorln prints an formatted error message using fmt.Fprintln function

func (*StdLogger) Info

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

Info prints an formatted output message using fmt.Fprint function

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 prints an formatted output message using fmt.Fprintf function

func (*StdLogger) Infoln

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

Infoln prints an formatted output message using fmt.Fprintln function

type StdLoggerBuilder

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

StdLoggerBuilder is a type which contains the configuration to build the logger which uses standard output and error streams or custom writers

func NewStdLoggerBuilder

func NewStdLoggerBuilder() *StdLoggerBuilder

NewStdLoggerBuilder returns new StdLoggerBuilder object

func (*StdLoggerBuilder) Build

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

Build creates a new logger instance with configuration stored in 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 set input output streams

Jump to

Keyboard shortcuts

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