@@ -335,7 +335,7 @@ impl<'cfg> HttpRegistry<'cfg> {
335
335
} ) ,
336
336
RetryResult :: Err ( e) => Err ( e) ,
337
337
RetryResult :: Retry ( sleep) => {
338
- debug ! ( "download retry {:?} for {sleep}ms" , download. path) ;
338
+ debug ! ( target : "network" , "download retry {:?} for {sleep}ms" , download. path) ;
339
339
self . downloads . sleeping . push ( sleep, ( download, handle) ) ;
340
340
continue ;
341
341
}
@@ -551,7 +551,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
551
551
&& path == Path :: new ( RegistryConfig :: NAME )
552
552
&& self . config . cli_unstable ( ) . registry_auth =>
553
553
{
554
- debug ! ( "re-attempting request for config.json with authorization included." ) ;
554
+ debug ! ( target : "network" , "re-attempting request for config.json with authorization included." ) ;
555
555
self . fresh . remove ( path) ;
556
556
self . auth_required = true ;
557
557
@@ -568,9 +568,11 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
568
568
}
569
569
}
570
570
Ok ( challenge) => {
571
- debug ! ( "ignoring non-Cargo challenge: {}" , challenge. scheme)
571
+ debug ! ( target: "network" , "ignoring non-Cargo challenge: {}" , challenge. scheme)
572
+ }
573
+ Err ( e) => {
574
+ debug ! ( target: "network" , "failed to parse challenge: {}" , e)
572
575
}
573
- Err ( e) => debug ! ( "failed to parse challenge: {}" , e) ,
574
576
}
575
577
}
576
578
}
@@ -618,7 +620,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
618
620
619
621
let mut handle = http_handle ( self . config ) ?;
620
622
let full_url = self . full_url ( path) ;
621
- debug ! ( "fetch {}" , full_url) ;
623
+ debug ! ( target : "network" , "fetch {}" , full_url) ;
622
624
handle. get ( true ) ?;
623
625
handle. url ( & full_url) ?;
624
626
handle. follow_location ( true ) ?;
@@ -653,7 +655,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
653
655
self . auth_error_headers . clone ( ) ,
654
656
) ?;
655
657
headers. append ( & format ! ( "Authorization: {}" , authorization) ) ?;
656
- trace ! ( "including authorization for {}" , full_url) ;
658
+ trace ! ( target : "network" , "including authorization for {}" , full_url) ;
657
659
}
658
660
handle. http_headers ( headers) ?;
659
661
@@ -662,7 +664,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
662
664
// We do that through this token. Each request (and associated response) gets one.
663
665
let token = self . downloads . next ;
664
666
self . downloads . next += 1 ;
665
- debug ! ( "downloading {} as {}" , path. display( ) , token) ;
667
+ debug ! ( target : "network" , "downloading {} as {}" , path. display( ) , token) ;
666
668
let is_new = self . downloads . pending_paths . insert ( path. to_path_buf ( ) ) ;
667
669
assert ! ( is_new, "path queued for download more than once" ) ;
668
670
@@ -671,7 +673,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
671
673
// That thread-local is set up in `block_until_ready` when it calls self.multi.perform,
672
674
// which is what ultimately calls this method.
673
675
handle. write_function ( move |buf| {
674
- trace ! ( "{} - {} bytes of data" , token, buf. len( ) ) ;
676
+ trace ! ( target : "network" , "{} - {} bytes of data" , token, buf. len( ) ) ;
675
677
tls:: with ( |downloads| {
676
678
if let Some ( downloads) = downloads {
677
679
downloads. pending [ & token]
@@ -772,7 +774,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
772
774
}
773
775
774
776
fn block_until_ready ( & mut self ) -> CargoResult < ( ) > {
775
- trace ! (
777
+ trace ! ( target : "network" ,
776
778
"block_until_ready: {} transfers pending" ,
777
779
self . downloads. pending. len( )
778
780
) ;
@@ -787,15 +789,15 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
787
789
. perform ( )
788
790
. with_context ( || "failed to perform http requests" )
789
791
} ) ?;
790
- trace ! ( "{} transfers remaining" , remaining_in_multi) ;
792
+ trace ! ( target : "network" , "{} transfers remaining" , remaining_in_multi) ;
791
793
792
794
if remaining_in_multi + self . downloads . sleeping . len ( ) as u32 == 0 {
793
795
return Ok ( ( ) ) ;
794
796
}
795
797
796
798
if self . downloads . pending . is_empty ( ) {
797
799
let delay = self . downloads . sleeping . time_to_next ( ) . unwrap ( ) ;
798
- debug ! ( "sleeping main thread for {delay:?}" ) ;
800
+ debug ! ( target : "network" , "sleeping main thread for {delay:?}" ) ;
799
801
std:: thread:: sleep ( delay) ;
800
802
} else {
801
803
// We have no more replies to provide the caller with,
0 commit comments