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

[go] Pad pretty-print header when goroutine id printed #21

Open
4 tasks
gabe-l-hart opened this issue Aug 8, 2021 · 0 comments
Open
4 tasks

[go] Pad pretty-print header when goroutine id printed #21

gabe-l-hart opened this issue Aug 8, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed lang: go type: code

Comments

@gabe-l-hart
Copy link
Collaborator

Description

As a developer using pretty-print formatting to view my logs, I want the headers to all align so that I can visually scan my log output.

Details

Currently, when enabling -log.goroutine-id, the logging may look like:

2021/08/08 20:32:33 <example-server> [MAIN :INFO:1] Logging Configured!
2021/08/08 20:32:33 <example-server> [MAIN :INFO:1] Hello World!
2021/08/08 20:32:34 <example-server> [HNDLR:WARN:19]   WATCH OUT!
2021/08/08 20:32:34 <example-server> [HNDLR:INFO:19]   Standard stuff...
2021/08/08 20:32:34 <example-server> [HNDLR:WARN:5]   WATCH OUT!
2021/08/08 20:32:34 <example-server> [HNDLR:INFO:5]   Standard stuff...
2021/08/08 20:32:34 <example-server> [HNDLR:DBUG:5]   Query Params:

In this example, the length of the goroutine-id portion of the pretty-print header is different on different lines, making visual parsing difficult.

Acceptance Criteria

  • Pretty-print headers are a fixed width (possibly increasing as max-length goroutine-id seen, but never decreasing)
  • Json formatting is unchanged
  • The implementation does not need to look-ahead at future logs to determine the padding size
  • Padding validated in unit tests
@gabe-l-hart gabe-l-hart added the help wanted Extra attention is needed label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed lang: go type: code
Projects
None yet
Development

No branches or pull requests

1 participant