Documentation ¶
Index ¶
- Constants
- func Black(s any) string
- func BlackBold(s any) string
- func Blue(s any) string
- func BlueBold(s any) string
- func Bold(s any) string
- func Colorize(s any, c Color) string
- func Cyan(s any) string
- func CyanBold(s any) string
- func DarkGray(s any) string
- func DarkGrayBold(s any) string
- func DisableColor()
- func EnableColor()
- func Green(s any) string
- func GreenBold(s any) string
- func Magenta(s any) string
- func MagentaBold(s any) string
- func Red(s any) string
- func RedBold(s any) string
- func Reset(s any) string
- func White(s any) string
- func WhiteBold(s any) string
- func Yellow(s any) string
- func YellowBold(s any) string
- type Color
- type ColorFunc
Constants ¶
const ( // LEFT_ARROW is the unicode string for a left arrow glyph LEFT_ARROW = "\u21fe" // BULLET_POINT is the unicode string for a triangular bullet point BULLET_POINT = "\u2023" )
This enum is to identify special unicode characters that will be used for pretty console output
Variables ¶
This section is empty.
Functions ¶
func BlackBold ¶
BlackBold is a ColorFunc that returns a black-bold-colorized string of the provided input
func BlueBold ¶
BlueBold is a ColorFunc that returns a blue-bold-colorized string of the provided input
func Colorize ¶
Colorize returns the string s wrapped in ANSI code c for non-windows systems Source: https://github.com/rs/zerolog/blob/4fff5db29c3403bc26dee9895e12a108aacc0203/console.go
func CyanBold ¶
CyanBold is a ColorFunc that returns a cyan-bold-colorized string of the provided input
func DarkGray ¶
DarkGray is a ColorFunc that returns a dark-gray-colorized string of the provided input
func DarkGrayBold ¶
DarkGrayBold is a ColorFunc that returns a dark-gray-bold-colorized string of the provided input
func DisableColor ¶ added in v0.1.3
func DisableColor()
DisableColor disables the use of colors for non-windows systems.
func EnableColor ¶
func EnableColor()
EnableColor enables the use of colors for non-windows systems.
func GreenBold ¶
GreenBold is a ColorFunc that returns a green-bold-colorized string of the provided input
func MagentaBold ¶
MagentaBold is a ColorFunc that returns a magenta-bold-colorized string of the provided input
func RedBold ¶
RedBold is a ColorFunc that returns a red-bold-colorized string of the provided input
func Reset ¶
Reset is a ColorFunc that simply returns the input as a string. It is basically a no-op and is used for resetting the color context during complex logging operations.
func WhiteBold ¶
WhiteBold is a ColorFunc that returns a white-bold-colorized string of the provided input
func YellowBold ¶
YellowBold is a ColorFunc that returns a yellow-bold-colorized string of the provided input
Types ¶
type Color ¶
type Color int
const ( // BLACK is the ANSI code for black BLACK Color = iota + 30 // COLOR_RED is the ANSI code for red RED // GREEN is the ANSI code for green GREEN // YELLOW is the ANSI code for yellow YELLOW // BLUE is the ANSI code for blue BLUE // MAGENTA is the ANSI code for magenta MAGENTA // CYAN is the ANSI code for cyan CYAN // WHITE is the ANSI code for white WHITE // BOLD is the ANSI code for bold tet BOLD = 1 // DARK_GRAY is the ANSI code for dark gray DARK_GRAY = 90 )
This is taken from zerolog's repo and will be used to colorize log output Source: https://github.com/rs/zerolog/blob/4fff5db29c3403bc26dee9895e12a108aacc0203/console.go