MCPcopy Create free account
hub / github.com/google/pprof / PrintErr

Method PrintErr

pprof.go:75–84  ·  view source on GitHub ↗

PrintErr shows a message to the user, colored in red for emphasis. It is printed over stderr as stdout is reserved for regular output.

(args ...interface{})

Source from the content-addressed store, hash-verified

73// PrintErr shows a message to the user, colored in red for emphasis.
74// It is printed over stderr as stdout is reserved for regular output.
75func (r *readlineUI) PrintErr(args ...interface{}) {
76 text := fmt.Sprint(args...)
77 if !strings.HasSuffix(text, "\n") {
78 text += "\n"
79 }
80 if readline.IsTerminal(int(syscall.Stderr)) {
81 text = colorize(text)
82 }
83 fmt.Fprint(r.rl.Stderr(), text)
84}
85
86// colorize the msg using ANSI color escapes.
87func colorize(msg string) string {

Callers

nothing calls this directly

Calls 2

colorizeFunction · 0.85
IsTerminalMethod · 0.65

Tested by

no test coverage detected