Documentation
¶
Index ¶
- Constants
- Variables
- func EmitEmpty()
- func Errorf(format string, a ...interface{}) error
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func Fatalln(a ...interface{})
- func Fprint(w io.Writer, a ...interface{}) (n int, err error)
- func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
- func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
- func GetDefaultOutput() io.Writer
- func OmitEmpty()
- func Print(a ...interface{}) (n int, err error)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(a ...interface{}) (n int, err error)
- func ResetColorScheme()
- func ResetDefaultOutput()
- func SetColorScheme(scheme ColorScheme)
- func SetDefaultOutput(o io.Writer)
- func SetIndentWidth(width uint8)
- func Sprint(a ...interface{}) string
- func Sprintf(format string, a ...interface{}) string
- func Sprintln(a ...interface{}) string
- func StrToTime(str string) time.Time
- func WithLineInfo(with bool)
- type ColorScheme
Constants ¶
const ( Black uint16 Red Green Yellow Blue Magenta Cyan White )
const ( BackgroundBlack uint16 BackgroundRed BackgroundGreen BackgroundYellow BackgroundBlue BackgroundMagenta BackgroundCyan BackgroundWhite )
const ( // Bold flag for ColorScheme. Bold uint16 = 1<<bitsBold | NoColor )
const ( // No color NoColor uint16 = 1 << 15 )
Variables ¶
var ( // If the length of array or slice is larger than this, // the buffer will be shorten as {...}. BufferFoldThreshold = 1024 )
var ( // If you set false to this variable, you can use pretty formatter // without coloring. ColoringEnabled = true )
Functions ¶
func Fatal ¶
func Fatal(a ...interface{})
Fatal prints given arguments and finishes execution with exit status 1.
func Fatalf ¶
func Fatalf(format string, a ...interface{})
Fatalf prints a given format and finishes execution with exit status 1.
func Fatalln ¶
func Fatalln(a ...interface{})
Fatalln prints given arguments with newline and finishes execution with exit status 1.
func GetDefaultOutput ¶
GetDefaultOutput returns pp's default output.
func SetColorScheme ¶
func SetColorScheme(scheme ColorScheme)
SetColorScheme takes a colorscheme used by all future Print calls.
func SetDefaultOutput ¶
Change Print* functions' output to a given writer. For example, you can limit output by ENV.
func init() {
if os.Getenv("DEBUG") == "" {
pp.SetDefaultOutput(ioutil.Discard)
}
}
func Sprint ¶
func Sprint(a ...interface{}) string
Sprint formats given arguemnts and returns the result as string.
func Sprintln ¶
func Sprintln(a ...interface{}) string
Sprintln formats given arguemnts with newline and returns the result as string.
func WithLineInfo ¶
func WithLineInfo(with bool)
WithLineInfo add file name and line information to output call this function with care, because getting stack has performance penalty




