summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-09-16 15:41:52 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-09-16 15:41:52 +0200
commitccde4a437999267ae1f62316bebcc09ea7dc027d (patch)
tree2d5a1f62b976264557af3fe4a40e8e531a249c06
parent7b404a6d2321f27e9a808aca267bf8f9e4e681aa (diff)
Use tracing rather than std(out|err)
-rw-r--r--src/db.rs2
-rw-r--r--src/graphql/types/alert.rs6
-rw-r--r--src/graphql/types/jwt.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/db.rs b/src/db.rs
index b74550b..4a9e9a7 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -11,7 +11,7 @@ pub async fn setup() -> Result<Client, AppError> {
// Spawn a new task to run the connection to the database
tokio::spawn(async move {
if let Err(e) = connection.await {
- eprintln!("Database connection error: {}", e);
+ tracing::error!("Database connection error: {}", e);
}
});
diff --git a/src/graphql/types/alert.rs b/src/graphql/types/alert.rs
index 2ee0087..69e8f31 100644
--- a/src/graphql/types/alert.rs
+++ b/src/graphql/types/alert.rs
@@ -338,7 +338,7 @@ pub mod mutations {
)
.await
{
- eprintln!(
+ tracing::error!(
"Error for `{}`: {}",
format!("alert-{}-text-1.mp3", alert.id),
e
@@ -351,7 +351,7 @@ pub mod mutations {
)
.await
{
- eprintln!(
+ tracing::error!(
"Error for `{}`: {}",
format!("alert-{}-text-2.mp3", alert.id),
e
@@ -363,7 +363,7 @@ pub mod mutations {
)
.await
{
- eprintln!(
+ tracing::error!(
"Error for `{}`: {}",
format!("alert-{}-text-3.mp3", alert.id),
e
diff --git a/src/graphql/types/jwt.rs b/src/graphql/types/jwt.rs
index 5656dc5..b2a09c3 100644
--- a/src/graphql/types/jwt.rs
+++ b/src/graphql/types/jwt.rs
@@ -110,7 +110,7 @@ where
AppError::InvalidToken
}
_ => {
- eprintln!("{err:?}");
+ tracing::error!("{err:?}");
AppError::Unauthorized
}
})?;