logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StandardOutput

type StandardOutput struct {
	*loggingdecorator.ColoringScheme
	// contains filtered or unexported fields
}

StandardOutput is the implementation of standard output logging

func New

func New() *StandardOutput

New properly creates a new standard output logger initializing its internal state with default values

func (StandardOutput) Log

func (logger StandardOutput) Log(msg logging.LogMessage) error

Log writes the given log message to the standard output using the logger defined format

func (*StandardOutput) WithColoringScheme

func (logger *StandardOutput) WithColoringScheme(scheme *loggingdecorator.ColoringScheme) *StandardOutput

WithColoringScheme sets the coloring scheme and returns the logger itself

func (*StandardOutput) WithFormat

func (logger *StandardOutput) WithFormat(format string) *StandardOutput

WithFormat sets the logger format and returns the logger itself

type StandardOutputDispatcher

type StandardOutputDispatcher struct {
	logging.Dispatcher
}

StandardOutputDispatcher is a struct to encapsulate a logging logging.Dispatcher to allow us to add more methods

func NewStandardOutputDispatcher

func NewStandardOutputDispatcher() StandardOutputDispatcher

NewStandardOutputDispatcher creates a new StandardOutputDispatcher by initializing the required fields The new dispatcher has a standard output logger defined

func (StandardOutputDispatcher) Debug

func (l StandardOutputDispatcher) Debug(msg string)

Debug logs a debug message

func (StandardOutputDispatcher) Error

func (l StandardOutputDispatcher) Error(msg string)

Error logs an error message

func (StandardOutputDispatcher) Info

func (l StandardOutputDispatcher) Info(msg string)

Info logs an info message

func (StandardOutputDispatcher) Log

Log will log the given message

func (StandardOutputDispatcher) LogIf

func (l StandardOutputDispatcher) LogIf(message logging.LogMessage, shouldLog bool)

LogIf will log the given message only if `shouldLog` argument is `true`

func (StandardOutputDispatcher) Trace

func (l StandardOutputDispatcher) Trace(msg string)

Trace logs a trace message

func (StandardOutputDispatcher) Warn

func (l StandardOutputDispatcher) Warn(msg string)

Warn logs a warn message

Jump to

Keyboard shortcuts

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