@@ -234,6 +234,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
234234 }
235235
236236 /// Wrap `resolve_impl` with `tracing` information
237+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %directory. to_string_lossy( ) , specifier = specifier) ) ) ]
237238 async fn resolve_tracing (
238239 & self ,
239240 directory : & Path ,
@@ -430,6 +431,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
430431 }
431432
432433 // 3. If X begins with './' or '/' or '../'
434+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
433435 async fn require_relative (
434436 & self ,
435437 cached_path : & CachedPath ,
@@ -477,6 +479,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
477479 . await
478480 }
479481
482+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier) ) ) ]
480483 async fn require_bare (
481484 & self ,
482485 cached_path : & CachedPath ,
@@ -528,6 +531,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
528531 Ok ( ( parsed, None ) )
529532 }
530533
534+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
531535 async fn load_package_self_or_node_modules (
532536 & self ,
533537 cached_path : & CachedPath ,
@@ -577,6 +581,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
577581 Ok ( None )
578582 }
579583
584+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
580585 async fn load_as_file ( & self , cached_path : & CachedPath , ctx : & mut Ctx ) -> ResolveResult {
581586 // enhanced-resolve feature: extension_alias
582587 if let Some ( path) = self . load_extension_alias ( cached_path, ctx) . await ? {
@@ -639,6 +644,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
639644 self . load_index ( cached_path, ctx) . await
640645 }
641646
647+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
642648 async fn load_as_file_or_directory (
643649 & self ,
644650 cached_path : & CachedPath ,
@@ -666,6 +672,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
666672 Ok ( None )
667673 }
668674
675+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %path. path( ) . to_string_lossy( ) ) ) ) ]
669676 async fn load_extensions (
670677 & self ,
671678 path : & CachedPath ,
@@ -688,6 +695,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
688695 Ok ( None )
689696 }
690697
698+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
691699 async fn load_realpath (
692700 & self ,
693701 cached_path : & CachedPath ,
@@ -737,6 +745,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
737745 true
738746 }
739747
748+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
740749 async fn load_index ( & self , cached_path : & CachedPath , ctx : & mut Ctx ) -> ResolveResult {
741750 for main_file in & self . options . main_files {
742751 let main_path = cached_path. path ( ) . normalize_with ( main_file) ;
@@ -790,6 +799,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
790799 Ok ( None )
791800 }
792801
802+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
793803 async fn load_node_modules (
794804 & self ,
795805 cached_path : & CachedPath ,
@@ -871,6 +881,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
871881 }
872882
873883 #[ cfg( feature = "yarn_pnp" ) ]
884+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
874885 fn find_pnp_manifest (
875886 & self ,
876887 cached_path : & CachedPath ,
@@ -897,6 +908,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
897908 }
898909
899910 #[ cfg( feature = "yarn_pnp" ) ]
911+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
900912 async fn load_pnp (
901913 & self ,
902914 cached_path : & CachedPath ,
@@ -1000,6 +1012,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10001012 Ok ( None )
10011013 }
10021014
1015+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10031016 async fn load_package_self (
10041017 & self ,
10051018 cached_path : & CachedPath ,
@@ -1043,6 +1056,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10431056 }
10441057
10451058 /// RESOLVE_ESM_MATCH(MATCH)
1059+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10461060 async fn resolve_esm_match (
10471061 & self ,
10481062 specifier : & str ,
@@ -1082,6 +1096,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10821096 }
10831097
10841098 /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields]
1099+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = module_specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10851100 async fn load_browser_field (
10861101 & self ,
10871102 cached_path : & CachedPath ,
@@ -1346,6 +1361,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
13461361 Ok ( None )
13471362 }
13481363
1364+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip( self ) , fields( path = path. display( ) . to_string( ) ) ) ) ]
13491365 fn load_tsconfig < ' a > (
13501366 & ' a self ,
13511367 root : bool ,
0 commit comments