Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Colors = map[string]*Color{ "Blue": {Colorizer: termcolor.New(termcolor.FgBlue).Sprint}, "Green": {Colorizer: termcolor.New(termcolor.FgGreen).Sprint}, "Yellow": {Colorizer: termcolor.New(termcolor.FgYellow).Sprint}, "Red": {Colorizer: termcolor.New(termcolor.FgRed).Sprint}, "BoldRed": {Colorizer: termcolor.New(termcolor.FgRed).Add(termcolor.Bold).Sprint}, "Danger": {Colorizer: termcolor.New(termcolor.FgBlack).Add(termcolor.Bold).Add(termcolor.BgRed).Sprint}, }
map Colors is the list of known colors. After adding a color here, be sure to add a key of the same name in muxytail.conf.
Functions ¶
func Colorize ¶ added in v1.0.5
Colorize iterates over each Color and applies all of the regexps associated with that color to the supplied string.
func ColorizeString ¶ added in v1.0.5
ColorizeString returns the string argument in a specific color.
Types ¶
type Color ¶
type Color struct { // RE is a slice of regexps that, when matched, are colorized RE []*regexp.Regexp // Colorizer is a Sprint() method of a color from fatih/color Colorizer func(...any) string }
struct Color holds the configuration for each handled termcolor.
Click to show internal directories.
Click to hide internal directories.