loggo: github.com/juju/loggo/loggocolor Index | Files

package loggocolor

import "github.com/juju/loggo/loggocolor"

Index

Package Files

writer.go

Variables

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)
)

func NewColorWriter Uses

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 Uses

func NewWriter(writer io.Writer) loggo.Writer

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

Package loggocolor imports 5 packages (graph) and is imported by 8 packages. Updated 2019-02-25. Refresh now. Tools for package owners.