cli

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

[leg100]: copy and pasted from apex pkg: * reduced padding from 3 to 1 * changed debug color from white to magneta (so I can see it on my solarized-light terminal scheme!)

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

Index

Constants

This section is empty.

Variables

Colors mapping.

View Source
var Default = New(os.Stdout, os.Stderr)

Default handler

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

Strings mapping.

Functions

This section is empty.

Types

type Handler

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

Handler implementation.

func New

func New(stdout io.Writer, stderr io.Writer) *Handler

New handler.

func (*Handler) HandleLog

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

HandleLog implements log.Handler.

func (*Handler) Writer

func (h *Handler) Writer(level log.Level) io.Writer

Jump to

Keyboard shortcuts

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