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

Flip task and stream name around in log output to reduce vertical shifts when looking through multiple log lines. #639

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erdii
Copy link
Member

@erdii erdii commented Feb 13, 2025

For me, it's easier to figure out the stream name (ERR or OUT) when it
always sits at the same place in the log line, like this:

2025-02-13 08:48:29.933 [OUT govulncheck] Scanning your code and 1222 packages across 148 dependent modules for known vulnerabilities...
2025-02-13 08:48:29.933 [OUT govulncheck]
2025-02-13 08:48:29.933 [OUT govulncheck] Fetching vulnerabilities from the database...
2025-02-13 08:48:29.933 [OUT govulncheck]
2025-02-13 08:48:30.139 [OUT govulncheck] Checking the code against the vulnerabilities...
2025-02-13 08:48:30.139 [OUT govulncheck]
2025-02-13 08:48:30.141 [OUT anothertaskname] blablablabal
2025-02-13 08:48:30.141 [ERR anothertaskname] blablablabal
2025-02-13 08:48:30.139 [ERR govulncheck] oh no an error

This is how the output currently looks:

2025-02-13 08:48:29.933 [govulncheck OUT] Scanning your code and 1222 packages across 148 dependent modules for known vulnerabilities...
2025-02-13 08:48:29.933 [govulncheck OUT]
2025-02-13 08:48:29.933 [govulncheck OUT] Fetching vulnerabilities from the database...
2025-02-13 08:48:29.933 [govulncheck OUT]
2025-02-13 08:48:30.139 [govulncheck OUT] Checking the code against the vulnerabilities...
2025-02-13 08:48:30.139 [govulncheck OUT]
2025-02-13 08:48:30.141 [anothertaskname OUT] blablablabal
2025-02-13 08:48:30.141 [anothertaskname ERR] blablablabal
2025-02-13 08:48:30.139 [govulncheck ERR] oh no an error

Signed-off-by: Josh Gwosdz [email protected]

when looking through multiple log lines.

For me, it's easier to figure out the stream name (ERR or OUT) when it
always sits at the same place in the log line, like this:
```
2025-02-13 08:48:29.933 [OUT govulncheck] Scanning your code and 1222 packages across 148 dependent modules for known vulnerabilities...
2025-02-13 08:48:29.933 [OUT govulncheck]
2025-02-13 08:48:29.933 [OUT govulncheck] Fetching vulnerabilities from the database...
2025-02-13 08:48:29.933 [OUT govulncheck]
2025-02-13 08:48:30.139 [OUT govulncheck] Checking the code against the vulnerabilities...
2025-02-13 08:48:30.139 [OUT govulncheck]
2025-02-13 08:48:30.141 [OUT anothertaskname] blablablabal
2025-02-13 08:48:30.141 [ERR anothertaskname] blablablabal
2025-02-13 08:48:30.139 [ERR govulncheck] oh no an error
```

This is how the output currently looks:
```
2025-02-13 08:48:29.933 [govulncheck OUT] Scanning your code and 1222 packages across 148 dependent modules for known vulnerabilities...
2025-02-13 08:48:29.933 [govulncheck OUT]
2025-02-13 08:48:29.933 [govulncheck OUT] Fetching vulnerabilities from the database...
2025-02-13 08:48:29.933 [govulncheck OUT]
2025-02-13 08:48:30.139 [govulncheck OUT] Checking the code against the vulnerabilities...
2025-02-13 08:48:30.139 [govulncheck OUT]
2025-02-13 08:48:30.141 [anothertaskname OUT] blablablabal
2025-02-13 08:48:30.141 [anothertaskname ERR] blablablabal
2025-02-13 08:48:30.139 [govulncheck ERR] oh no an error
```

Signed-off-by: Josh Gwosdz <[email protected]>
@erdii erdii requested a review from a team as a code owner February 13, 2025 08:55
@erdii erdii requested a review from radimous February 13, 2025 08:55
@erdii erdii changed the title [ Flip task and stream name around in log output to reduce vertical shifts when looking through multiple log lines. Feb 13, 2025
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.21%. Comparing base (f5c2331) to head (49f042c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #639   +/-   ##
=======================================
  Coverage   62.21%   62.21%           
=======================================
  Files          13       13           
  Lines        1003     1003           
=======================================
  Hits          624      624           
  Misses        340      340           
  Partials       39       39           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant