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

SortingFunc works wrong in first log message when used TextFormatter and output is colored #1371

Closed
artem-leonov opened this issue Feb 16, 2023 · 5 comments
Labels

Comments

@artem-leonov
Copy link

Hi!
When output is colored and SortingFunc specified, it works incorrect in first log message and output fields may be printed in random order. Example on screenshot
Снимок экрана 2023-02-16 в 09 08 42

It happens because terminal initialization placed after sort https://github.com/sirupsen/logrus/blob/master/text_formatter.go#L196. Sorting logic checks output is colored and when terminal not initialized it defined as not colored, so custom keys sorts with fixed and writes in fixed keys. After that in printing method sends variable keys which not sorted.

@artem-leonov
Copy link
Author

I think it fixed in #1298, but it's still not merged

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 19, 2023
@artem-leonov
Copy link
Author

issue is actual

@github-actions github-actions bot removed the stale label Mar 21, 2023
@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 21, 2023
@github-actions
Copy link

github-actions bot commented May 6, 2023

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant