cli

package
Version: v0.0.0-...-fe3c858 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var Colors = [...]int{
	log.DebugLevel:     gray,
	log.InfoLevel:      blue,
	log.NoticeLevel:    blue,
	log.WarnLevel:      yellow,
	log.ErrorLevel:     red,
	log.CriticalLevel:  red,
	log.AlertLevel:     red,
	log.EmergencyLevel: red,
}

Colors mapping.

View Source
var Default = New(os.Stderr)

Default handler outputting to stderr.

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

Strings mapping.

Functions

This section is empty.

Types

type Handler

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

Handler implementation.

func New

func New(w io.Writer) *Handler

New handler.

func (*Handler) HandleLog

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

HandleLog implements log.Handler.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL