Skip to content

Logger: properly print debug from errors#721

Merged
jbr merged 1 commit intohttp-rs:mainfrom
Fishrock123:logger-error-backtrace
Oct 15, 2020
Merged

Logger: properly print debug from errors#721
jbr merged 1 commit intohttp-rs:mainfrom
Fishrock123:logger-error-backtrace

Conversation

@Fishrock123
Copy link
Member

Also adds the error type name.

Fixes: #703

Also adds the error type name.

Fixes: http-rs#703
if let Some(error) = response.error() {
log::error!("Internal error --> Response sent", {
message: format!("\"{}\"", error.to_string()),
message: format!("{:?}", error),
Copy link
Member Author

Choose a reason for hiding this comment

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

When using the Debug formatter on Nightly with RUST_BACKTRACE enabled, this will also print out with a backtrace.

@Fishrock123 Fishrock123 force-pushed the logger-error-backtrace branch from aeb931f to c5854fb Compare October 9, 2020 22:23
@Fishrock123
Copy link
Member Author

I now have two codebases using custom loggers awaiting this, haha.

@jbr jbr merged commit d0966b9 into http-rs:main Oct 15, 2020
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.

tide::log::middleware: line number/backtrace for errors

2 participants