Documentation
¶
Overview ¶
Setup logger with zerolog and ansi colors for terminal output.
Index ¶
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" // Text Colors FgBlack = "\033[30m" FgRed = "\033[31m" FgGreen = "\033[32m" FgYellow = "\033[33m" FgBlue = "\033[34m" FgMagenta = "\033[35m" FgCyan = "\033[36m" FgWhite = "\033[37m" // Background Colors BgBlack = "\033[40m" BgRed = "\033[41m" BgGreen = "\033[42m" BgYellow = "\033[43m" BgBlue = "\033[44m" BgMagenta = "\033[45m" BgCyan = "\033[46m" BgWhite = "\033[47m" )
ANSI color codes for terminal output
Variables ¶
View Source
var Ansi = AnsiColors{ Reset: "\033[0m", Bold: "\033[1m", FgBlack: "\033[30m", FgRed: "\033[31m", FgGreen: "\033[32m", FgYellow: "\033[33m", FgBlue: "\033[34m", FgMagenta: "\033[35m", FgCyan: "\033[36m", FgWhite: "\033[37m", BgBlack: "\033[40m", BgRed: "\033[41m", BgGreen: "\033[42m", BgYellow: "\033[43m", BgBlue: "\033[44m", BgMagenta: "\033[45m", BgCyan: "\033[46m", BgWhite: "\033[47m", }
Create a variable of the struct type
Functions ¶
Types ¶
type AnsiColors ¶
type AnsiColors struct {
Reset string
Bold string
// Forground Colors
FgBlack string
FgRed string
FgGreen string
FgYellow string
FgBlue string
FgMagenta string
FgCyan string
FgWhite string
// Background Colors
BgBlack string
BgRed string
BgGreen string
BgYellow string
BgBlue string
BgMagenta string
BgCyan string
BgWhite string
}
tip structs are a collection of variables that can be used to group related data together tip structs can't be constants
Click to show internal directories.
Click to hide internal directories.