loggocolor

package module
v0.0.0-...-b55f5f3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 5 Imported by: 0

README

loggocolor

A version of github.com/juju/loggo/loggocolor which allows forcing of color capability

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SeverityColor defines the colors for the levels output by the colorWriter.
	SeverityColor = map[loggo.Level]*ansiterm.Context{
		loggo.TRACE:   ansiterm.Foreground(ansiterm.Default),
		loggo.DEBUG:   ansiterm.Foreground(ansiterm.Green),
		loggo.INFO:    ansiterm.Foreground(ansiterm.BrightBlue),
		loggo.WARNING: ansiterm.Foreground(ansiterm.Yellow),
		loggo.ERROR:   ansiterm.Foreground(ansiterm.BrightRed),
		loggo.CRITICAL: &ansiterm.Context{
			Foreground: ansiterm.White,
			Background: ansiterm.Red,
		},
	}
	// LocationColor defines the colors for the location output by the colorWriter.
	LocationColor = ansiterm.Foreground(ansiterm.BrightBlue)
)

Functions

func NewColorWriter

func NewColorWriter(writer io.Writer) loggo.Writer

NewcolorWriter will write out colored severity levels whether or not the writer is outputting to a terminal.

func NewWriter

func NewWriter(writer io.Writer) loggo.Writer

NewWriter will write out colored severity levels if the writer is outputting to a terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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