text

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 6 Imported by: 338

Documentation

Overview

Package text implements a development-friendly textual handler.

Index

Constants

This section is empty.

Variables

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

Colors mapping.

View Source
var Default = New(os.Stderr)

Default handler outputting to stderr.

View Source
var Strings = [...]string{
	log.DebugLevel: "DEBUG",
	log.InfoLevel:  "INFO",
	log.WarnLevel:  "WARN",
	log.ErrorLevel: "ERROR",
	log.FatalLevel: "FATAL",
}

Strings mapping.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Writer io.Writer
	// 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.

Jump to

Keyboard shortcuts

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