@@ -105,9 +105,13 @@ fn query_decls(route: &Route) -> Option<TokenStream> {
105
105
) *
106
106
107
107
if !__e. is_empty( ) {
108
- :: rocket:: trace:: span_info!( "codegen" ,
108
+ :: rocket:: trace:: span_info!(
109
+ "codegen" ,
109
110
"query string failed to match route declaration" =>
110
- { for _err in __e { :: rocket:: trace:: info!( "{_err}" ) ; } }
111
+ { for _err in __e { :: rocket:: trace:: info!(
112
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
113
+ "{_err}"
114
+ ) ; } }
111
115
) ;
112
116
113
117
return #Outcome :: Forward ( ( #__data, #Status :: UnprocessableEntity ) ) ;
@@ -128,17 +132,27 @@ fn request_guard_decl(guard: &Guard) -> TokenStream {
128
132
let #ident: #ty = match <#ty as #FromRequest >:: from_request( #__req) . await {
129
133
#Outcome :: Success ( __v) => __v,
130
134
#Outcome :: Forward ( __e) => {
131
- :: rocket:: trace:: info!( name: "forward" , parameter = stringify!( #ident) ,
132
- type_name = stringify!( #ty) , status = __e. code,
133
- "request guard forwarding" ) ;
135
+ :: rocket:: trace:: info!(
136
+ name: "forward" ,
137
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
138
+ parameter = stringify!( #ident) ,
139
+ type_name = stringify!( #ty) ,
140
+ status = __e. code,
141
+ "request guard forwarding"
142
+ ) ;
134
143
135
144
return #Outcome :: Forward ( ( #__data, __e) ) ;
136
145
} ,
137
146
#[ allow( unreachable_code) ]
138
147
#Outcome :: Error ( ( __c, __e) ) => {
139
- :: rocket:: trace:: info!( name: "failure" , parameter = stringify!( #ident) ,
140
- type_name = stringify!( #ty) , reason = %#display_hack!( __e) ,
141
- "request guard failed" ) ;
148
+ :: rocket:: trace:: info!(
149
+ name: "failure" ,
150
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
151
+ parameter = stringify!( #ident) ,
152
+ type_name = stringify!( #ty) ,
153
+ reason = %#display_hack!( __e) ,
154
+ "request guard failed"
155
+ ) ;
142
156
143
157
return #Outcome :: Error ( __c) ;
144
158
}
@@ -155,9 +169,14 @@ fn param_guard_decl(guard: &Guard) -> TokenStream {
155
169
156
170
// Returned when a dynamic parameter fails to parse.
157
171
let parse_error = quote ! ( {
158
- :: rocket:: trace:: info!( name: "forward" , parameter = #name,
159
- type_name = stringify!( #ty) , reason = %#display_hack!( __error) ,
160
- "path guard forwarding" ) ;
172
+ :: rocket:: trace:: info!(
173
+ name: "forward" ,
174
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
175
+ parameter = #name,
176
+ type_name = stringify!( #ty) ,
177
+ reason = %#display_hack!( __error) ,
178
+ "path guard forwarding"
179
+ ) ;
161
180
162
181
#Outcome :: Forward ( ( #__data, #Status :: UnprocessableEntity ) )
163
182
} ) ;
@@ -174,9 +193,12 @@ fn param_guard_decl(guard: &Guard) -> TokenStream {
174
193
} ,
175
194
#_None => {
176
195
:: rocket:: trace:: error!(
196
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
177
197
"Internal invariant broken: dyn param {} not found.\n \
178
198
Please report this to the Rocket issue tracker.\n \
179
- https://github.com/rwf2/Rocket/issues", #i) ;
199
+ https://github.com/rwf2/Rocket/issues",
200
+ #i
201
+ ) ;
180
202
181
203
return #Outcome :: Forward ( ( #__data, #Status :: InternalServerError ) ) ;
182
204
}
@@ -203,17 +225,27 @@ fn data_guard_decl(guard: &Guard) -> TokenStream {
203
225
let #ident: #ty = match <#ty as #FromData >:: from_data( #__req, #__data) . await {
204
226
#Outcome :: Success ( __d) => __d,
205
227
#Outcome :: Forward ( ( __d, __e) ) => {
206
- :: rocket:: trace:: info!( name: "forward" , parameter = stringify!( #ident) ,
207
- type_name = stringify!( #ty) , status = __e. code,
208
- "data guard forwarding" ) ;
228
+ :: rocket:: trace:: info!(
229
+ name: "forward" ,
230
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
231
+ parameter = stringify!( #ident) ,
232
+ type_name = stringify!( #ty) ,
233
+ status = __e. code,
234
+ "data guard forwarding"
235
+ ) ;
209
236
210
237
return #Outcome :: Forward ( ( __d, __e) ) ;
211
238
}
212
239
#[ allow( unreachable_code) ]
213
240
#Outcome :: Error ( ( __c, __e) ) => {
214
- :: rocket:: trace:: info!( name: "failure" , parameter = stringify!( #ident) ,
215
- type_name = stringify!( #ty) , reason = %#display_hack!( __e) ,
216
- "data guard failed" ) ;
241
+ :: rocket:: trace:: info!(
242
+ name: "failure" ,
243
+ target: concat!( "rocket::codegen::" , module_path!( ) ) ,
244
+ parameter = stringify!( #ident) ,
245
+ type_name = stringify!( #ty) ,
246
+ reason = %#display_hack!( __e) ,
247
+ "data guard failed"
248
+ ) ;
217
249
218
250
return #Outcome :: Error ( __c) ;
219
251
}
0 commit comments