Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow colored formatting #21

Open
ernado opened this issue Jul 29, 2022 · 0 comments
Open

feat: allow colored formatting #21

ernado opened this issue Jul 29, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ernado
Copy link
Member

ernado commented Jul 29, 2022

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 ernado added the enhancement New feature or request label Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant