log: github.com/apex/log/handlers/cli Index | Files

package cli

import "github.com/apex/log/handlers/cli"

Package cli implements a colored text handler suitable for command-line interfaces.

Index

Package Files

cli.go

Variables

var Colors = [...]*color.Color{
    log.DebugLevel: color.New(color.FgWhite),
    log.InfoLevel:  color.New(color.FgBlue),
    log.WarnLevel:  color.New(color.FgYellow),
    log.ErrorLevel: color.New(color.FgRed),
    log.FatalLevel: color.New(color.FgRed),
}

Colors mapping.

var Default = New(os.Stderr)

Default handler outputting to stderr.

var Strings = [...]string{
    log.DebugLevel: "•",
    log.InfoLevel:  "•",
    log.WarnLevel:  "•",
    log.ErrorLevel: "⨯",
    log.FatalLevel: "⨯",
}

Strings mapping.

type Handler Uses

type Handler struct {
    Writer  io.Writer
    Padding int
    // contains filtered or unexported fields
}

Handler implementation.

func New Uses

func New(w io.Writer) *Handler

New handler.

func (*Handler) HandleLog Uses

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

HandleLog implements log.Handler.

Package cli imports 8 packages (graph) and is imported by 99 packages. Updated 2020-04-29. Refresh now. Tools for package owners.