{"modulePath":"github.com/vcabbage/kit","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package term\n\nPackage term provides tools for logging to a terminal.\n\n## Constants\n\n```go\nconst (\n\tDefault = Color(iota)\n\n\tBlack\n\tDarkRed\n\tDarkGreen\n\tBrown\n\tDarkBlue\n\tDarkMagenta\n\tDarkCyan\n\tGray\n\n\tDarkGray\n\tRed\n\tGreen\n\tYellow\n\tBlue\n\tMagenta\n\tCyan\n\tWhite\n)\n```\nANSI colors.\n\n## Functions\n\n```go\nfunc IsTerminal(w io.Writer) bool\n```\nIsTerminal returns true if w writes to a terminal.\n\n```go\nfunc NewColorLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger\n```\nNewColorLogger returns a Logger which writes colored logs to w. ANSI color codes for the colors returned by color are added to the formatted output from the Logger returned by newLogger and the combined result written to w.\n\n```go\nfunc NewColorWriter(w io.Writer) io.Writer\n```\nNewColorWriter returns an io.Writer that writes to w and provides cross platform support for ANSI color codes. If w is not a terminal it is returned unmodified.\n\n```go\nfunc NewLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger\n```\nNewLogger returns a Logger that takes advantage of terminal features if possible. Log events are formatted by the Logger returned by newLogger. If w is a terminal each log event is colored according to the color function.\n\n## Types\n\n```go\ntype Color uint8\n```\nColor represents an ANSI color. The zero value is Default.\n\n```go\ntype FgBgColor struct {\n\tFg, Bg Color\n}\n```\nFgBgColor represents a foreground and background color.\n\n","path":"github.com/vcabbage/kit/log/term","name":"term","synopsis":"Package term provides tools for logging to a terminal.","isRedistributable":true}
