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

Is there a way to obtain the 'buf' from the Event in a hook? #637

Open
WUST-mengqinyu opened this issue Jan 17, 2024 · 2 comments
Open

Is there a way to obtain the 'buf' from the Event in a hook? #637

WUST-mengqinyu opened this issue Jan 17, 2024 · 2 comments

Comments

@WUST-mengqinyu
Copy link

Or alternatively, is it possible to get the 'Context' in the Writer?

@RmStorm
Copy link

RmStorm commented Apr 4, 2024

I would like something like this too! I have a hook that adds trace data to the logs. In that (or another) hook I would also like to add bits and pieces of the log event to the trace in cases of high severity. However now it's not possible to lift any information out of the zerolog event. a .Read() method on the event would be very nice.

edit: On further reading there seems to be a workable solution here #493 @WUST-mengqinyu would be nicer with something that doesn't involve reflecting though.

@rs
Copy link
Owner

rs commented Apr 4, 2024

The buf is an internal structure containing the incomplete event in the making. It is not meant to be exposed.

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

3 participants