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

fix race condition caused by writing to entry.Data #857

Merged
merged 2 commits into from Nov 22, 2018
Merged

Conversation

h12w
Copy link
Contributor

@h12w h12w commented Nov 5, 2018

This PR should be able to fix #468, and it uses the same technique as JSONFormatter.

@h12w h12w changed the title fix race condition caused by writing to entry.Data, fix race condition caused by writing to entry.Data Nov 5, 2018
text_formatter.go Outdated Show resolved Hide resolved
@@ -160,7 +163,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
timestampFormat = defaultTimestampFormat
}
if f.isColored() {
f.printColored(b, entry, keys, timestampFormat)
f.printColored(b, entry, keys, nil, timestampFormat)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we give the new data array as parameter here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@dgsb dgsb merged commit 29d7eb2 into sirupsen:master Nov 22, 2018
cgxxv pushed a commit to cgxxv/logrus that referenced this pull request Mar 25, 2022
fix race condition caused by writing to entry.Data
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.

Concurrent map error on text formatter caused by prefixFieldClashes
2 participants