msg

package
v0.0.0-...-66ba663 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blue   = "0;34"
	Red    = "0;31"
	Green  = "0;32"
	Yellow = "0;33"
	Cyan   = "0;36"
	Pink   = "1;35"
)

These contanstants map to color codes for shell scripts making them human readable.

Variables

View Source
var IsDebugging = false

IsDebugging, if true, shows verbose levels, like Debug.

View Source
var NoColor = false

NoColor, if true, will not use color in the output.

View Source
var Quiet = false

Quiet, if true, suppresses chatty levels, like Info.

View Source
var Stderr = os.Stderr

Stderr is the location where this prints logs.

View Source
var Stdout = os.Stdout

Stdout is the location where this prints output.

Functions

func Color

func Color(code, msg string) string

Color returns a string in a certain color. The first argument is a string containing the color code or a constant from the table above mapped to a code.

The following will print the string "Foo" in yellow:

fmt.Print(Color(Yellow, "Foo"))

func Debug

func Debug(msg string, args ...interface{})

Debug logs debug information

func ErrMsg

func ErrMsg(msg string, args ...interface{})

ErrMsg sends a message to Stderr

func Error

func Error(msg string, args ...interface{})

Error logs and error.

func Info

func Info(msg string, args ...interface{})

Info logs information

func Msg

func Msg(msg string, args ...interface{})

Msg prints a message with optional arguments, that can be printed, of varying types.

func Puts

func Puts(msg string, args ...interface{})

Puts formats a message and then prints to Stdout.

It does not prefix the message, does not color it, or otherwise decorate it.

It does add a line feed.

func Warn

func Warn(msg string, args ...interface{})

Warn logs a warning

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL