logger

package
v1.25.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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 that contains references to the console output for debug and info logging levels.

func DefaultLogger

func DefaultLogger(platform string) (Logger, error)

DefaultLogger creates a new instance of Logger, suppressing debug output unless BP_DEBUG is set.

func NewLogger

func NewLogger(debug io.Writer, info io.Writer) Logger

NewLogger creates a new instance of Logger, configuring the debug and info writers to use. If writer is nil, that logging level is disabled.

func (Logger) Debug

func (l Logger) Debug(format string, args ...interface{})

Debug prints output to the configured debug writer, interpolating the format and any arguments and adding a newline at the end. If debug logging is not enabled, nothing is printed.

func (Logger) Info

func (l Logger) Info(format string, args ...interface{})

Info prints output to the configured info writer, interpolating the format and any arguments and adding a newline at the end. If info logging is not enabled, nothing is printed.

func (Logger) IsDebugEnabled

func (l Logger) IsDebugEnabled() bool

IsDebugEnabled returns true if debug logging is enabled, false otherwise.

func (Logger) IsInfoEnabled

func (l Logger) IsInfoEnabled() bool

IsInfoEnabled returns true if info logging is enabled, false otherwise.

Jump to

Keyboard shortcuts

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