log

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerBuilder

func NewLoggerBuilder() builder

Types

type FLogger

type FLogger interface {
	SpinnerMessage(string)
	StartSpinner(string) error
	StopSpinner(error) error

	Info(args ...interface{})
	Infof(format string, args ...interface{})

	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
}

type FLoggerImpl

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

func (*FLoggerImpl) Debug

func (l *FLoggerImpl) Debug(args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Debug("test debug log with debug disabled")
Output:

Example (WithDebugEnabled)
logger, _ := NewLoggerBuilder().WithDebug(true).Build()
logger.Debug("test debug log with debug enabled")
Output:

DEBUG: test debug log with debug enabled

func (*FLoggerImpl) Debugf

func (l *FLoggerImpl) Debugf(format string, args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Debugf("test debug log %s with debug disabled", "with format")
Output:

Example (WithDebugEnabled)
logger, _ := NewLoggerBuilder().WithDebug(true).Build()
logger.Debugf("test debug log %s with debug enabled", "with format")
Output:

DEBUG: test debug log with format with debug enabled

func (*FLoggerImpl) Info

func (l *FLoggerImpl) Info(args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Info("test info log")
Output:

test info log

func (*FLoggerImpl) Infof

func (l *FLoggerImpl) Infof(format string, args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Infof("test info log %s", "with format")
Output:

test info log with format

func (*FLoggerImpl) SpinnerMessage

func (l *FLoggerImpl) SpinnerMessage(msg string)

func (*FLoggerImpl) StartSpinner

func (l *FLoggerImpl) StartSpinner(msg string) error

StartSpinner starts the spinner with the given message adding "\n" at the end.

func (*FLoggerImpl) StopSpinner

func (l *FLoggerImpl) StopSpinner(err error) error

StopSpinner stops the spinner with success if err is nil, fail othewise.

Jump to

Keyboard shortcuts

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