logging

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 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 FormatCallPath added in v0.7.0

func FormatCallPath(callDepth int, depth int) string

func InitLogLevel

func InitLogLevel(ll string, trace bool)

func LogLevel added in v0.9.3

func LogLevel() string

func TraceLog added in v0.9.3

func TraceLog() 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