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

Feature request: Log formatting #6

Open
sslupsky opened this issue May 18, 2019 · 3 comments
Open

Feature request: Log formatting #6

sslupsky opened this issue May 18, 2019 · 3 comments

Comments

@sslupsky
Copy link
Contributor

sslupsky commented May 18, 2019

It would be helpful if a timestamp could be added and the output could be formatted as logfmt.

https://www.brandur.org/logfmt

ie: <timestamp> <key1>=<value1> <key2>=<value2> ...

example:

[1234] level=info msg="<insert zeroregs info here">"

@drewfish
Copy link
Owner

This is an interesting idea. It might be possible with the current version of ZeroRegs, since struct ZeroRegOptions has a Stream& member, which you could specify as your own custom implementation which wraps the message as you suggest. I'll play around to see if that might work.

drewfish added a commit that referenced this issue May 21, 2019
In this example we create a custom Stream& which wraps the output lines.

This hopefully addresses feature request #6.
@drewfish
Copy link
Owner

Yeah I think you can do this yourself by creating a Stream which wraps the output. Check out PR #8, which might in fact be what you want.

drewfish added a commit that referenced this issue May 21, 2019
In this example we create a custom Stream& which wraps the output lines.

This hopefully addresses feature request #6.
@sslupsky
Copy link
Contributor Author

Thanks for the example. I haven't had a chance yet to test it out but I should have some time next week to try it.

drewfish added a commit that referenced this issue May 21, 2020
In this example we create a custom Stream& which wraps the output lines.

This hopefully addresses feature request #6.
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

2 participants