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

emit does not seek the end of the file before flush #179

Open
tseste opened this issue Jul 29, 2021 · 1 comment
Open

emit does not seek the end of the file before flush #179

tseste opened this issue Jul 29, 2021 · 1 comment

Comments

@tseste
Copy link

tseste commented Jul 29, 2021

Hey there,

I've been using your package lately and I noticed that before the logger flushes a message,
it is not seeking for the end of the file.

For me it was an issue because I use one more stream to write to the same file, and that other stream actually
handles the seek before writing.

It is really a very small change and it might help others to.

The addition is to use seekend(handler.io) in the beginning of emit function here

function emit(handler::DefaultHandler{F, O}, rec::Record) where {F<:Formatter, O<:IO}

Let's say line 207

@tseste
Copy link
Author

tseste commented Jul 29, 2021

Actually, more like

if typeof(handler.io) <: IOStream
    seekend(handler.io)
end

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

No branches or pull requests

1 participant