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

Lazy..ing the log message formatting & idiomatic vs C style #21

Open
jrouaix opened this issue Aug 12, 2024 · 1 comment
Open

Lazy..ing the log message formatting & idiomatic vs C style #21

jrouaix opened this issue Aug 12, 2024 · 1 comment

Comments

@jrouaix
Copy link
Contributor

jrouaix commented Aug 12, 2024

Hi,

Our use case read the full unified logs but does not bother about all the logs.

Could be great if we could skip the message formating while reading, but be able and turn the message field of LogData into a message() function that actually Lazy compute the full formatted message on demand.

I wanted to dig this possibility and just landed a refacto of the LogData creation code => shindan-io@a43b75e

All our tests are passing just same and fine with this change.

Not sure what I first wanted to do is possible as the log_message formatting sometimes mut the missing parts.

First I'd like to know if you like this mode rust idiomatic style of code (IMHO).
I could have some more rustdiomatic changes to contribute, but perhaps the actual code style was I requirement on your side, that's why I'm asking here.

@puffyCid
Copy link
Collaborator

Turning message into message() seems like a reasonable change. I am also fine with changes making the code more rust idiomatic

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