Skip to content

show only error logs as error#5

Merged
patostickar merged 2 commits into
mainfrom
pretty-logs
Apr 17, 2026
Merged

show only error logs as error#5
patostickar merged 2 commits into
mainfrom
pretty-logs

Conversation

@patostickar
Copy link
Copy Markdown
Collaborator

Stop showing debug logs as errors and only show error logs if they are truly error ones

@patostickar patostickar requested a review from psenderos March 26, 2026 12:19
@patostickar patostickar self-assigned this Mar 26, 2026
Comment thread output/stderr.go
if strings.Contains(msg, "error") || strings.Contains(msg, "failed") || strings.Contains(msg, "fatal") {
logrus.Error(msg)
} else {
logrus.Debug(msg)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @patostickar would this appear even without the --debug flag, or would it be better to log it as Info?
Also, shouldn't the string be lowercase so it also catches "ERROR" or "Error"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psenderos, if errors are real errors, they will appear without the need for the debug flag to be enabled.

There I lowercased the msg 💪

@patostickar patostickar merged commit c41c52d into main Apr 17, 2026
1 check passed
@patostickar patostickar deleted the pretty-logs branch April 17, 2026 17:05
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.

3 participants