Navigation Menu

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

zerolog: refactor considering data is encoded immediatelly on an internal buffer #10

Merged
merged 4 commits into from Jan 19, 2023

Conversation

amery
Copy link
Collaborator

@amery amery commented Jan 17, 2023

I should have read zerolog's code before making assumptions

Copy link
Collaborator

@karasz karasz left a comment

Choose a reason for hiding this comment

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

I am not a fan of GetEvent as it returns two unrelated results. Either I do not understand the code or GetEvent() should only return ev, for the bool value one should just call zl.Enabled() as that is also exported. So again IMVHO you either unexport Enabled() and rely on GetEvent() or drop the bool from GetEvent() and leave Enabled as exported. I lean towards the later.

method changed to mimick what *Event provides,
and when there is an event we also use it to know
if the logging should proceed

Signed-off-by: Alejandro Mery <amery@jpi.io>
Signed-off-by: Alejandro Mery <amery@jpi.io>
…Contexts

Signed-off-by: Alejandro Mery <amery@jpi.io>
…ctly supported by zerolog

the event is a buffer, so calling Interface for each item is the same
as calling zerolog's Fields() would do

Signed-off-by: Alejandro Mery <amery@jpi.io>
@amery
Copy link
Collaborator Author

amery commented Jan 18, 2023

@karasz amended. split in 4 more meaningful commits now. I got rid of GetEvent()

@amery amery changed the title zerolog: refactor considering data is encoded on immediatelly zerolog: refactor considering data is encoded immediatelly on an internal buffer Jan 18, 2023
Copy link
Collaborator

@karasz karasz left a comment

Choose a reason for hiding this comment

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

LGTM

@amery amery merged commit 695c8f4 into main Jan 19, 2023
@amery amery deleted the pr-amery-zerolog branch January 19, 2023 10:09
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.

None yet

2 participants