@@ -233,6 +233,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
233233 }
234234
235235 /// Wrap `resolve_impl` with `tracing` information
236+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %directory. to_string_lossy( ) , specifier = specifier) ) ) ]
236237 async fn resolve_tracing (
237238 & self ,
238239 directory : & Path ,
@@ -429,6 +430,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
429430 }
430431
431432 // 3. If X begins with './' or '/' or '../'
433+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
432434 async fn require_relative (
433435 & self ,
434436 cached_path : & CachedPath ,
@@ -476,6 +478,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
476478 . await
477479 }
478480
481+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier) ) ) ]
479482 async fn require_bare (
480483 & self ,
481484 cached_path : & CachedPath ,
@@ -527,6 +530,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
527530 Ok ( ( parsed, None ) )
528531 }
529532
533+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
530534 async fn load_package_self_or_node_modules (
531535 & self ,
532536 cached_path : & CachedPath ,
@@ -576,6 +580,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
576580 Ok ( None )
577581 }
578582
583+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
579584 async fn load_as_file ( & self , cached_path : & CachedPath , ctx : & mut Ctx ) -> ResolveResult {
580585 // enhanced-resolve feature: extension_alias
581586 if let Some ( path) = self . load_extension_alias ( cached_path, ctx) . await ? {
@@ -638,6 +643,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
638643 self . load_index ( cached_path, ctx) . await
639644 }
640645
646+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
641647 async fn load_as_file_or_directory (
642648 & self ,
643649 cached_path : & CachedPath ,
@@ -665,6 +671,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
665671 Ok ( None )
666672 }
667673
674+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %path. path( ) . to_string_lossy( ) ) ) ) ]
668675 async fn load_extensions (
669676 & self ,
670677 path : & CachedPath ,
@@ -687,6 +694,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
687694 Ok ( None )
688695 }
689696
697+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
690698 async fn load_realpath (
691699 & self ,
692700 cached_path : & CachedPath ,
@@ -736,6 +744,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
736744 true
737745 }
738746
747+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
739748 async fn load_index ( & self , cached_path : & CachedPath , ctx : & mut Ctx ) -> ResolveResult {
740749 for main_file in & self . options . main_files {
741750 let main_path = cached_path. path ( ) . normalize_with ( main_file) ;
@@ -789,6 +798,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
789798 Ok ( None )
790799 }
791800
801+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
792802 async fn load_node_modules (
793803 & self ,
794804 cached_path : & CachedPath ,
@@ -870,6 +880,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
870880 }
871881
872882 #[ cfg( feature = "yarn_pnp" ) ]
883+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
873884 fn find_pnp_manifest (
874885 & self ,
875886 cached_path : & CachedPath ,
@@ -896,6 +907,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
896907 }
897908
898909 #[ cfg( feature = "yarn_pnp" ) ]
910+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
899911 async fn load_pnp (
900912 & self ,
901913 cached_path : & CachedPath ,
@@ -999,6 +1011,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
9991011 Ok ( None )
10001012 }
10011013
1014+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10021015 async fn load_package_self (
10031016 & self ,
10041017 cached_path : & CachedPath ,
@@ -1042,6 +1055,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10421055 }
10431056
10441057 /// RESOLVE_ESM_MATCH(MATCH)
1058+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10451059 async fn resolve_esm_match (
10461060 & self ,
10471061 specifier : & str ,
@@ -1081,6 +1095,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10811095 }
10821096
10831097 /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields]
1098+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip_all, fields( specifier = module_specifier, path = %cached_path. path( ) . to_string_lossy( ) ) ) ) ]
10841099 async fn load_browser_field (
10851100 & self ,
10861101 cached_path : & CachedPath ,
@@ -1345,6 +1360,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
13451360 Ok ( None )
13461361 }
13471362
1363+ #[ cfg_attr( feature="enable_instrument" , tracing:: instrument( level=tracing:: Level :: DEBUG , skip( self ) , fields( path = path. display( ) . to_string( ) ) ) ) ]
13481364 fn load_tsconfig < ' a > (
13491365 & ' a self ,
13501366 root : bool ,
0 commit comments