Skip to content

refactor(updater): replace log crate with tracing for improved logging #2592

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

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

thep0y
Copy link

@thep0y thep0y commented Apr 3, 2025

No description provided.

@thep0y thep0y requested a review from a team as a code owner April 3, 2025 01:46
Copy link
Contributor

github-actions bot commented Apr 3, 2025

Package Changes Through d407712

There are 3 changes which include log with minor, log-js with minor, updater with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.24 2.0.25
api-example-js 2.0.20 2.0.21
log 2.3.1 2.4.0
log-js 2.3.1 2.4.0
updater 2.7.0 2.7.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master
Copy link
Contributor

Is there any reason in particular to use tracing instead of log? Like we didn't use span or anything, wouldn't log be enough?

@thep0y
Copy link
Author

thep0y commented Apr 7, 2025

If logs are recorded using the log crate, when a user's project uses tracing to record logs, it becomes difficult to log messages in the updater due to the difference in logging frameworks. This can be resolved using tracing_log, but it is not the optimal solution. Currently, all implemented plugins mix the use of log and tracing. In this scenario, using tracing as the default logger is a better choice. Of course, the best implementation would be to make tracing an optional or default feature for each plugin, rather than specifying it as a dependency.

@Legend-Master
Copy link
Contributor

I see, I feel like we probably want to rethink about where to use log where to use trace, I didn't even realize that we're mixing the two all over the place 😅

cc @lucasfernog since you added the logs

@lucasfernog
Copy link
Member

why is tracing_log not optimal? there will always be a bunch of crates using either log or tracing (or in our case, incorrectly mixing both). I see log as the common factor between them, and we use tracing mostly when it's marked as an optional feature (which I agree is a bit weird).

@thep0y
Copy link
Author

thep0y commented Apr 8, 2025

All plugins should have tracing as an optional dependency, allowing users to conveniently choose either log or tracing as the logger.

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.

3 participants