logger

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceLVL   = "trace"
	InfoLVL    = "info"
	WarningLVL = "warning"
	ErrorLVL   = "error"
)

log levels

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger type contains methods for logging

func (*Logger) Configure

func (l *Logger) Configure(logLevel string) error

Configure configures the io.Writer values for each log level

func (Logger) Configured

func (l Logger) Configured() bool

Configured returns the status of the logger

func (Logger) Error

func (l Logger) Error(message interface{})

Error prints error logs if they are enabled

func (Logger) Info

func (l Logger) Info(message interface{})

Info prints info logs if they are enabled

func (*Logger) Init

func (l *Logger) Init(
	traceHandle io.Writer,
	infoHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

Init takes io.Writers for each type of log level. logger.Configure() should be used unless you have very specific io.Writer requirements

func (Logger) Level

func (l Logger) Level() string

Level returns the configured log level

func (Logger) Trace

func (l Logger) Trace(message interface{})

Trace prints trace logs if they are enabled

func (Logger) Warning

func (l Logger) Warning(message interface{})

Warning prints warning logs if they are enabled

Jump to

Keyboard shortcuts

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