Skip to content

Commit 63fafdf

Browse files
committed
Convert to proper tracing structure
1 parent 8bcd168 commit 63fafdf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/lib/src/fs/server.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,10 @@ impl<F> Rewriter for MapFile<F>
268268
pub fn dir_root(path: impl AsRef<Path>)
269269
-> impl for<'p, 'h> Fn(File<'p, 'h>, &Request<'_>) -> FileResponse<'p, 'h> + Send + Sync + 'static
270270
{
271-
use yansi::Paint as _;
272-
273271
let path = path.as_ref();
274272
if !path.is_dir() {
275273
let path = path.display();
276-
error!("FileServer path '{}' is not a directory.", path.primary());
274+
error!(%path, "FileServer path is not a directory.");
277275
warn!("Aborting early to prevent inevitable handler error.");
278276
panic!("invalid directory: refusing to continue");
279277
}
@@ -301,12 +299,10 @@ pub fn dir_root(path: impl AsRef<Path>)
301299
pub fn file_root(path: impl AsRef<Path>)
302300
-> impl for<'p, 'h> Fn(File<'p, 'h>, &Request<'_>) -> FileResponse<'p, 'h> + Send + Sync + 'static
303301
{
304-
use yansi::Paint as _;
305-
306302
let path = path.as_ref();
307303
if !path.exists() {
308304
let path = path.display();
309-
error!("FileServer path '{}' is not a file.", path.primary());
305+
error!(%path, "FileServer path does not exist.");
310306
warn!("Aborting early to prevent inevitable handler error.");
311307
panic!("invalid file: refusing to continue");
312308
}

0 commit comments

Comments
 (0)