Skip to content

Replace log and env_logger with tracing crates #3115

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

Merged
merged 2 commits into from
Dec 28, 2020
Merged

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 23, 2020

This brings us closer to being able to use structured logging and properly instrumenting some of functions. The change is mostly a drop-in replacement as described by https://docs.rs/tracing/0.1.22/tracing/#for-log-users.

The only difference is the slightly changed log output format:

# before
[2020-12-23T21:51:50Z INFO  cargo_registry::app] test23

# after
Dec 23 22:53:48.847  INFO cargo_registry::app: test23

This could be massaged by using a custom FormatEvent implementation though, if we really need this to be formatted in a specific way. Otherwise there is also a JSON-based output format which might be beneficial in production for real structured logging.

r? @pietroalbini

@pietroalbini
Copy link
Member

I think you also need to update the test suite, after #3130 landed.

@Turbo87
Copy link
Member Author

Turbo87 commented Dec 28, 2020

yep, you're totally right 👍

should be fixed now :)

@pietroalbini
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 28, 2020

📌 Commit 8b36e01 has been approved by pietroalbini

@bors
Copy link
Contributor

bors commented Dec 28, 2020

⌛ Testing commit 8b36e01 with merge b6bc89f...

@bors
Copy link
Contributor

bors commented Dec 28, 2020

☀️ Test successful - checks-actions
Approved by: pietroalbini
Pushing b6bc89f to master...

@bors bors merged commit b6bc89f into rust-lang:master Dec 28, 2020
@Turbo87 Turbo87 deleted the tracing branch December 28, 2020 12:38
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.

4 participants