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

Use the tracing crate for debug logging and e.g. RUST_LOG=debug to activate #564

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

Enselic
Copy link
Owner

@Enselic Enselic commented Mar 29, 2024

From previous discussions my impression is that ideally we would use the tracing crate for logging.

While investigating #561 I got a good reason to improve debug logging, so I switched to tracing. It does add a handful of more deps, but I think it's worth it. Great logging capabilities are very nice to have.

Obviously we can add more logging later, but this is a start.

I don't think anyone is using verbose, so going through a deprecation cycle would be overkill. Let's just remove it but release a new 0.x.0 version just to be safe.

@Enselic Enselic added the category-exclude Will be excluded from the auto-generated release notes. label Mar 29, 2024
Copy link
Collaborator

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! a minor note

@@ -290,6 +290,7 @@ pub enum Action {
const LATEST_VERSION_ARG: &str = "latest";

fn main_() -> Result<()> {
tracing_subscriber::fmt::init();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default is to log to stdout, see https://togithub.com/tokio-rs/tracing/issues/2492

should be changed to stderr via the builder

Copy link
Owner Author

@Enselic Enselic Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch. I have now added a regression test that would have caught this mistake (and will catch similar mistakes in the future).

I don't think anyone is using `verbose()`, so going through a
deprecation cycle would be overkill. Let's just remove it but release a
new 0.x.0 version just to be safe.
@Enselic Enselic merged commit 4137fb9 into main Apr 2, 2024
10 checks passed
@Enselic Enselic deleted the tracing branch April 2, 2024 11:07
@Enselic Enselic added category-other For other changes. and removed category-exclude Will be excluded from the auto-generated release notes. labels Apr 2, 2024
@Enselic Enselic temporarily deployed to preview-release-notes April 2, 2024 11:48 — with GitHub Actions Inactive
@Enselic Enselic changed the title Replace rustdoc_json::Builder::verbose with the tracing crate Use the tracing crate for debug logging and e.g. RUST_LOG=debug to activate Apr 2, 2024
@Enselic Enselic temporarily deployed to preview-release-notes April 2, 2024 11:50 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category-other For other changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants