import "github.com/Kenshin/cprint"
Color Print(cp) is ANSI coloured text to the standard output by Golang. Vesion 0.0.1
Website https://github.com/kenshin/cprint, depends on https://github.com/daviddengcn/go-colortext
Copyright (c) 2014 Kenshin Wang <kenshin@ksria.com>
const ( DEFAULT = "" WARING = "Waring" ERROR = "Error" NOTICE = "Notice" )
Print flag, include:
- DEFAULT - WARING - ERROR - NOTICE
Color uint, include:
- None - Black - Red - Green - Yellow - Blue - Magenta - Cyan - White
const SPLIT = "%v"
Parse identifying
ANSI coloured erro text to the standard output
flag : Include 'Default', 'Waring', 'Error', 'Notice' message: Print content err : Error content
For example:
Error(ERROR, "util/print.go an error has occurred. Error: ", err)
ANSI coloured text to the standard output
flag : Include 'Default', 'Waring', 'Error', 'Notice' message: Print content args : Variable parameter, include string, CP type, when args last value is "\n", auto new line.
For example 1:
P(WARING, "Remote latest version %v = latest version %v.\n", param1, param2)
For example 2:
cp := CP{1, true, 2, true, localVersion} P(DEFAULT, "Current version %v, publish data: ", cp, "2014-05-31")
For example 3:
P(DEFAULT, "Current version %v", localVersion, "\n")
Color Print
- FgColor : Foreground color - FgBright: Foreground color is it bright? - BgColor : Background color - BgBright: Background color is it bright? - Value : Color Message
Package cprint imports 5 packages (graph) and is imported by 4 packages. Updated 2016-07-23. Refresh now. Tools for package owners.