Skip to content

Commit

Permalink
Identify logs we write in outside modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcldan committed Jun 6, 2024
1 parent 6a28edd commit 0c15bec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/codegen/src/attribute/route/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,17 @@ fn request_guard_decl(guard: &Guard) -> TokenStream {
let #ident: #ty = match <#ty as #FromRequest>::from_request(#__req).await {
#Outcome::Success(__v) => __v,
#Outcome::Forward(__e) => {
::rocket::trace::info!(name: "forward", parameter = stringify!(#ident),
let target = ::std::format!("{}::_rocket", ::std::module_path!());
::rocket::trace::info!(name: "forward", target: &target, parameter = stringify!(#ident),
type_name = stringify!(#ty), status = __e.code,
"request guard forwarding");

return #Outcome::Forward((#__data, __e));
},
#[allow(unreachable_code)]
#Outcome::Error((__c, __e)) => {
::rocket::trace::info!(name: "failure", parameter = stringify!(#ident),
let target = ::std::format!("{}::_rocket", ::std::module_path!());
::rocket::trace::info!(name: "failure", target: &target, parameter = stringify!(#ident),
type_name = stringify!(#ty), reason = %#display_hack!(__e),
"request guard failed");

Expand Down

0 comments on commit 0c15bec

Please sign in to comment.