@@ -4,8 +4,8 @@ use std::sync::Arc;
4
4
use std:: time:: Duration ;
5
5
use std:: any:: Any ;
6
6
use std:: future:: Future ;
7
+ use std:: panic:: Location ;
7
8
8
- use yansi:: Paint ;
9
9
use either:: Either ;
10
10
use figment:: { Figment , Provider } ;
11
11
use futures:: TryFutureExt ;
@@ -21,7 +21,6 @@ use crate::phase::{Stateful, StateRef, State};
21
21
use crate :: http:: uri:: Origin ;
22
22
use crate :: http:: ext:: IntoOwned ;
23
23
use crate :: error:: { Error , ErrorKind } ;
24
- // use crate::log::PaintExt;
25
24
26
25
/// The application server itself.
27
26
///
@@ -248,20 +247,18 @@ impl Rocket<Build> {
248
247
B :: Error : fmt:: Display ,
249
248
M : Fn ( & Origin < ' a > , T ) -> T ,
250
249
F : Fn ( & mut Self , T ) ,
251
- T : Clone + fmt :: Display ,
250
+ T : Clone + Traceable ,
252
251
{
253
252
let mut base = match base. clone ( ) . try_into ( ) {
254
253
Ok ( origin) => origin. into_owned ( ) ,
255
254
Err ( e) => {
256
- error ! ( "invalid {} base: {}" , kind, Paint :: white( & base) ) ;
257
- error_ ! ( "{}" , e) ;
258
- info_ ! ( "{} {}" , "in" . primary( ) , std:: panic:: Location :: caller( ) ) ;
255
+ error ! ( %base, location = %Location :: caller( ) , "invalid {kind} base uri: {e}" ) ;
259
256
panic ! ( "aborting due to {} base error" , kind) ;
260
257
}
261
258
} ;
262
259
263
260
if base. query ( ) . is_some ( ) {
264
- warn ! ( "query in {} base '{}' is ignored" , kind , Paint :: white ( & base ) ) ;
261
+ warn ! ( %base , location = % Location :: caller ( ) , "query in {kind } base is ignored" ) ;
265
262
base. clear_query ( ) ;
266
263
}
267
264
0 commit comments