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

[journald] Writter should return written size when message was sent without error #190

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

IljaN
Copy link
Contributor

@IljaN IljaN commented Oct 13, 2019

The journald writer currently always returns zero. This causes an ErrShortWrite if used together with MultiWriter: https://github.com/golang/go/blob/master/src/io/multi.go#L64

  • Fixes ErrShortWrite if used with io.MultiWriter

@rs
Copy link
Owner

rs commented Oct 13, 2019

Tests are failing. Can you please fix them so I can merge?

@IljaN
Copy link
Contributor Author

IljaN commented Oct 13, 2019

Not sure, need to debug, they pass locally.

Edit: With go test -v ./...

@rs
Copy link
Owner

rs commented Oct 13, 2019

Try with go test -tags binary_log

@IljaN IljaN force-pushed the fix/journaldwriter_size branch from 2b7a673 to c21c63c Compare October 13, 2019 08:31
- Fixes ErrShortWrite error if used with io.MultiWriter
@IljaN IljaN force-pushed the fix/journaldwriter_size branch from c21c63c to d74cfa2 Compare October 13, 2019 09:38
@plar
Copy link

plar commented Jan 15, 2020

@rs Could you merge that PR into the master please? Tests have been fixed.

github.com/IljaN/zerolog(master)$ go test -tags binary_log
PASS
ok  	github.com/rs/zerolog	0.011s

@IljaN IljaN requested a review from rs January 15, 2020 16:29
@rs rs merged commit 505b18d into rs:master Jan 15, 2020
@IljaN IljaN deleted the fix/journaldwriter_size branch January 16, 2020 12:34
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