...

Source file src/github.com/go-kit/kit/log/term/colorlogger.go

Documentation: github.com/go-kit/kit/log/term

     1  package term
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/go-kit/log"
     7  	"github.com/go-kit/log/term"
     8  )
     9  
    10  // Color represents an ANSI color. The zero value is Default.
    11  type Color = term.Color
    12  
    13  // ANSI colors.
    14  const (
    15  	Default = term.Default
    16  
    17  	Black       = term.Black
    18  	DarkRed     = term.DarkRed
    19  	DarkGreen   = term.DarkGreen
    20  	Brown       = term.Brown
    21  	DarkBlue    = term.DarkBlue
    22  	DarkMagenta = term.DarkMagenta
    23  	DarkCyan    = term.DarkCyan
    24  	Gray        = term.Gray
    25  
    26  	DarkGray = term.DarkGray
    27  	Red      = term.Red
    28  	Green    = term.Green
    29  	Yellow   = term.Yellow
    30  	Blue     = term.Blue
    31  	Magenta  = term.Magenta
    32  	Cyan     = term.Cyan
    33  	White    = term.White
    34  )
    35  
    36  // FgBgColor represents a foreground and background color.
    37  type FgBgColor = term.FgBgColor
    38  
    39  // NewColorLogger returns a Logger which writes colored logs to w. ANSI color
    40  // codes for the colors returned by color are added to the formatted output
    41  // from the Logger returned by newLogger and the combined result written to w.
    42  func NewColorLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger {
    43  	return term.NewColorLogger(w, newLogger, color)
    44  }
    45  

View as plain text