Skip to content

Commit 3b771a2

Browse files
fix tracing
1 parent 67573c9 commit 3b771a2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ shell-words = "1.1.0"
2020
tempfile = "3.18.0"
2121

2222
tokio = { version = "1", features = ["macros"] }
23+
tracing = "0.1.41"
2324
uuid = { version = "1.15.1", features = ["v4"] }
2425

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
//! Taken from https://github.com/tokio-rs/axum/blob/main/examples/anyhow-error-response/src/main.rs
33
44
use axum::{http::StatusCode, response::{IntoResponse, Response}};
5-
use lambda_http::tracing::error;
5+
use tracing::error;
66

77
// Make our own error that wraps `anyhow::Error`.
88
pub struct AppError(anyhow::Error);
99

1010
// Tell axum how to convert `AppError` into a response.
1111
impl IntoResponse for AppError {
1212
fn into_response(self) -> Response {
13-
error!("Returning Internal Server Error: {:?}", self.0);
13+
error!(error = ?self.0, "Returning Internal Server Error");
1414
(
1515
StatusCode::INTERNAL_SERVER_ERROR,
1616
format!("Internal Server Error: {:?}", self.0),

0 commit comments

Comments
 (0)