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

Replace SystemTime with Instant #187

Merged
merged 1 commit into from
Jan 31, 2022
Merged

Conversation

jssblck
Copy link
Contributor

@jssblck jssblck commented Jan 29, 2022

Hey there! Thanks for making such a great library!

I recently got started with Poem and needed to customize the default Tracing middleware, so I looked at its implementation and noticed it was using SystemTime.

I thought switching to Instant would make the code a bit simpler while preserving the intent, but happy to close if you disagree. Thanks!

Comment on lines 55 to 59
tracing::info!(
status = %resp.status(),
"response"
error = %err,
duration = ?duration,
"error"
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also a slight change in functionality- I personally thought it'd be useful to see the duration of failed requests too, but totally fine to change this back if you'd prefer.

@sunli829
Copy link
Collaborator

I agree! Using SystemTime will be slightly faster than Instant, but keeping the code simple should be more important.

@sunli829 sunli829 merged commit 4333dae into poem-web:master Jan 31, 2022
@jssblck jssblck deleted the tracing-instant branch February 1, 2022 18:07
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