fix(logs): make tracing target consistent
This commit is contained in:
@@ -54,7 +54,7 @@ impl Error for ContactError {}
|
|||||||
/// issues beyond the client's control.
|
/// issues beyond the client's control.
|
||||||
impl From<lettre::transport::smtp::Error> for ContactError {
|
impl From<lettre::transport::smtp::Error> for ContactError {
|
||||||
fn from(value: lettre::transport::smtp::Error) -> Self {
|
fn from(value: lettre::transport::smtp::Error) -> Self {
|
||||||
tracing::event!(target: "contact", tracing::Level::ERROR, "SMTP Error details: {}", format!("{value:?}"));
|
tracing::event!(target: "backend::contact", tracing::Level::ERROR, "SMTP Error details: {}", format!("{value:?}"));
|
||||||
Self::OtherError(value.to_string())
|
Self::OtherError(value.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ impl ContactApi {
|
|||||||
"New contact form submission:\n\nName: {}\nEmail: {}\n\nMessage:\n{}",
|
"New contact form submission:\n\nName: {}\nEmail: {}\n\nMessage:\n{}",
|
||||||
request.name, request.email, request.message
|
request.name, request.email, request.message
|
||||||
);
|
);
|
||||||
tracing::event!(target: "email", tracing::Level::DEBUG, "Sending email content to recipient: {}", email_body);
|
tracing::event!(target: "backend::contact", tracing::Level::DEBUG, "Sending email content to recipient: {}", email_body);
|
||||||
let email = Message::builder()
|
let email = Message::builder()
|
||||||
.from(self.settings.try_sender_into_mailbox()?)
|
.from(self.settings.try_sender_into_mailbox()?)
|
||||||
.reply_to(request.try_into()?)
|
.reply_to(request.try_into()?)
|
||||||
@@ -224,7 +224,7 @@ impl ContactApi {
|
|||||||
.subject(format!("Contact Form: {}", request.name))
|
.subject(format!("Contact Form: {}", request.name))
|
||||||
.header(ContentType::TEXT_PLAIN)
|
.header(ContentType::TEXT_PLAIN)
|
||||||
.body(email_body)?;
|
.body(email_body)?;
|
||||||
tracing::event!(target: "contact", tracing::Level::DEBUG, "Email to be sent: {}", format!("{email:?}"));
|
tracing::event!(target: "backend::contact", tracing::Level::DEBUG, "Email to be sent: {}", format!("{email:?}"));
|
||||||
Ok(email)
|
Ok(email)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user