logging

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Colors mapping.

View Source
var Strings = [...]string{
	log.DebugLevel: "DEBUG",
	log.InfoLevel:  "INFO",
	log.WarnLevel:  "WARN",
	log.ErrorLevel: "ERROR",
	log.FatalLevel: "FATAL",
}

Strings mapping.

Functions

func InitLogLevel

func InitLogLevel(ll string, trace bool)

Types

type BannerPrintStyle

type BannerPrintStyle int

BannerPrintStyle - describe how to print banner when log is hidden.

const (
	// SpinnerStyle show spinet with timer.
	SpinnerStyle BannerPrintStyle = iota
	// LineStile - print banner in newline with time 10 sec. (like terraform)
	LineStile
)

type DelayHandler

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

DelayHandler implementation.

func NewDelayHandler

func NewDelayHandler(timeout time.Duration, banner string, bannerStyle BannerPrintStyle) *DelayHandler

NewDelayHandler handler.

func (*DelayHandler) Close

func (h *DelayHandler) Close() error

Close the handler.

func (*DelayHandler) HandleLog

func (h *DelayHandler) HandleLog(e *log.Entry) error

HandleLog implements log.Handler.

type LogWriter

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

LogWriter io writer for logging driver.

func NewLogWriter

func NewLogWriter(logLevel log.Level, fielder log.Fielder) (*LogWriter, error)

NewLogWriter create log io writer.

func (*LogWriter) Write

func (l *LogWriter) Write(p []byte) (n int, err error)

Write func - standart io write interface.

type SliceFielder

type SliceFielder struct {
	Flds []string
}

func (SliceFielder) Fields

func (s SliceFielder) Fields() log.Fields

type StdHandler

type StdHandler struct {
	Writer io.Writer
	// contains filtered or unexported fields
}

StdHandler implementation.

func NewLogStdHandler

func NewLogStdHandler() *StdHandler

NewLogStdHandler - new custom log handler for apex log lib.

func (*StdHandler) HandleLog

func (h *StdHandler) HandleLog(e *log.Entry) error

HandleLog implements log.Handler.

Jump to

Keyboard shortcuts

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