errors icon indicating copy to clipboard operation
errors copied to clipboard

feat: allow colored formatting

Open ernado opened this issue 3 years ago • 0 comments

Use github.com/fatih/color, highlight error text, stacktrace parts (line number, path to file, stacktrace element) with different colors and bold/faint.

Example of colored formatted string:

fmt.Println(
	color.New(color.FgCyan).Sprintf("[%5s]", time.Since(start).Round(time.Second)),
	color.New().Sprint(req.Method),
	color.New(color.Faint).Sprint(req.URL),
	color.New(color.FgYellow).Sprint(lastStatus),
)

Probably implement it as some variant of %+v formatting (do we support flags in formatting strings here?).

ernado avatar Jul 29 '22 17:07 ernado