logging

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package logging contains some basic loggin setup.

Index

Constants

This section is empty.

Variables

Colors mapping.

View Source
var Strings = [...]string{
	logg.LevelDebug: "•",
	logg.LevelInfo:  "•",
	logg.LevelWarn:  "•",
	logg.LevelError: "⨯",
}

Strings mapping.

Functions

func FormatBuildDuration

func FormatBuildDuration(d time.Duration) string

FormatBuildDuration formats a duration to a string on the form expected in "Total in ..." etc.

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal return true if the file descriptor is terminal and the TERM environment variable isn't a dumb one.

func NewDefaultHandler

func NewDefaultHandler(outWriter, errWriter io.Writer) logg.Handler

NewDefaultHandler handler.

func Replacer

func Replacer(repl *strings.Replacer) logg.Handler

Replacer creates a new log handler that does string replacement in log messages.

Types

type DefaultHandler

type DefaultHandler struct {
	Padding int
	// contains filtered or unexported fields
}

Default Handler implementation. Based on https://github.com/apex/log/blob/master/handlers/cli/cli.go

func (*DefaultHandler) HandleLog

func (h *DefaultHandler) HandleLog(e *logg.Entry) error

HandleLog implements logg.Handler.

type NoColoursHandler

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

func NewNoColoursHandler

func NewNoColoursHandler(outWriter, errWriter io.Writer) *NoColoursHandler

NewNoColoursHandler creates a new NoColoursHandler

func (*NoColoursHandler) HandleLog

func (h *NoColoursHandler) HandleLog(e *logg.Entry) error

Jump to

Keyboard shortcuts

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