Pretty Printer package used for colorful console output support for Golang
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
PrettyPrinter.go
README.md
colors.go

README.md

PrettyPrinter

Pretty Printer package used for colorful console output support for Golang

Usage

Pretty Printer simpyfies writing colorful output to command line providing simple API which is more readable than:

	fmt.Printf("\x1b[47m\x1b[31;1mRed title: \x1b[0m%s: \n\x1b[32;1mBody: \x1b[0m%s\x1b[0m\n", "Sample title param", "Sample body param")

With this API you can do:

	fmt.Print(prettyPrinter.New().
		BgYellow().BoldRed("Red title: ").Text("%s: \n").
		BoldGreen("Body: ").Text("%s\n").
		Format("Sample title param", "Sample body param"))

Every text element (colorful or not) will reset background color

Sample above will have following output:

Alt text