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

feat: replace env logger with debug log #4663

Merged
merged 3 commits into from
Jun 24, 2024
Merged

feat: replace env logger with debug log #4663

merged 3 commits into from
Jun 24, 2024

Conversation

aljazerzen
Copy link
Member

@aljazerzen aljazerzen commented Jun 24, 2024

Instead of logging debug messages to stderr, any log::debug! or log::info! or log::trace! will now log messages into the debug-log.html/debug-log.json.

image

@aljazerzen aljazerzen requested a review from max-sixty June 24, 2024 13:05
@max-sixty
Copy link
Member

max-sixty commented Jun 24, 2024

The track record of this is very good, so I defer to you even more than usual. :)


I would generally raise an eyebrow at us having our own logging framework, relative to using something that's more standard, since we reimplement a bunch of things ourselves and it raises the bar a bit for newer contributors. FWIW a quick browse suggests there are some well-supported structured logging crates around, such as tracing (+ tracing-appender which allows writing for files).

It is nice to have a single output of logs & stages. That would be more difficult with my (2) suggestion in #4646 of writing the JSON out to a specific file rather than as exhaust, since at least logs are exhaust. So if this is the closest way of getting that, sobeit. If we really want, we can always switch out the bottom layer another time.

@aljazerzen
Copy link
Member Author

Yeah, I was hesitant to do this at first too, but it is not really a logging framework, just a logging backend - a writer to a different location.

I have to try this new development first and then decide if it is any good.


The great potential with thid debug log is that when all the logs are in .html, we even do filtering on the fly. For example, compile the query once, capture all levels and then filter to isolate only the ones that you need.

@aljazerzen aljazerzen merged commit 9b2c576 into main Jun 24, 2024
81 of 83 checks passed
@aljazerzen aljazerzen deleted the debug-log-messages branch June 24, 2024 21:04
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.

2 participants