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

Potentially switch from log to tracing #2177

Open
CosmicHorrorDev opened this issue Oct 26, 2022 · 7 comments
Open

Potentially switch from log to tracing #2177

CosmicHorrorDev opened this issue Oct 26, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@CosmicHorrorDev
Copy link
Contributor

CosmicHorrorDev commented Oct 26, 2022

Is your feature request related to a problem? Please describe.

tracing is becoming more common in the async ecosystem, while still providing functionality to support emitting log messages with the log feature. Having sqlx switch to tracing enables the ability to group events emitted by sqlx with tracing::spans

Describe the solution you'd like

Switch the internal logging over to tracing (I would be more than willing to follow through on this work)

Describe alternatives you've considered

Just keep using log instead of tracing

Additional context

This has been mentioned in passing in a couple of issues (Namely #1896 and #942): however, those mentioned tracing as a part of some other initiative, while this issue just focuses on the feasibility of swapping log for tracing

log::LevelFilter is used publicly. This would likely be swapped for an enum exposed by sqlx to avoid the public dependency on another crate. This means that this would be a breaking change

@CosmicHorrorDev CosmicHorrorDev added the enhancement New feature or request label Oct 26, 2022
@abonander
Copy link
Collaborator

This is a switch we've been wanting to do for a while. I'd be glad to land it as part of 0.7.0 but I don't have time to work on it personally.

@CosmicHorrorDev
Copy link
Contributor Author

I'll start working on it, but no promises that it'll be finished in time for v0.7

Feel free to ping me for progress updates 👍

@abonander abonander added this to the 0.7.0 milestone Oct 26, 2022
@taylor1791
Copy link

@LovecraftianHorror Do you think we can finish this faster if two of us work on it together? I would love to help expedite this change.

@CosmicHorrorDev
Copy link
Contributor Author

@taylor1791 I can throw up a draft PR with whatever I end up getting through this weekend. I would just divvy up the crates with you, but there will be some design changes that would be best to keep consistent since tracing handles some things slightly differently than log

I would definitely appreciate a second set of eyes on things, and I'll definitely ping you if I end up stalling out on the work (life has been busy lately)

@abonander
Copy link
Collaborator

Initial work done in #2185, to track the work of adding spans everywhere I suppose we could either keep this issue open or create a new one. Creating a new one is more likely to get the attention of someone driving by looking for some open-source work to do.

@fdietze
Copy link

fdietze commented Apr 8, 2023

Just wondering, would it be possible to make a release without this issue being solved? There are lots of great improvements on main already that are useful without this issue.

@CosmicHorrorDev
Copy link
Contributor Author

I don't think this issue is blocking release

@abonander abonander removed this from the 0.7.0 milestone Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants