@@ -150,15 +150,15 @@ impl ProxyInner {
150150 wg_ip : config. wg . ip . to_string ( ) ,
151151 } ;
152152 if let Err ( err) = kv_store. sync_node ( config. sync . node_id , & node_data) {
153- error ! ( "Failed to sync this node to KvStore: {err}" ) ;
153+ error ! ( "Failed to sync this node to KvStore: {err:? }" ) ;
154154 }
155155 // Set this node's status to Online
156156 if let Err ( err) = kv_store. set_node_status ( config. sync . node_id , NodeStatus :: Up ) {
157- error ! ( "Failed to set node status: {err}" ) ;
157+ error ! ( "Failed to set node status: {err:? }" ) ;
158158 }
159159 // Register this node's sync URL in DB (for peer discovery)
160160 if let Err ( err) = kv_store. register_peer_url ( config. sync . node_id , & config. sync . my_url ) {
161- error ! ( "Failed to register peer URL: {err}" ) ;
161+ error ! ( "Failed to register peer URL: {err:? }" ) ;
162162 }
163163
164164 // Build HttpsClientConfig for mTLS communication
@@ -185,7 +185,7 @@ impl ProxyInner {
185185 )
186186 . await
187187 {
188- warn ! ( "Failed to fetch peers from bootnode: {err}" ) ;
188+ warn ! ( "Failed to fetch peers from bootnode: {err:? }" ) ;
189189 }
190190 }
191191
@@ -194,7 +194,7 @@ impl ProxyInner {
194194 match WaveKvSyncService :: new ( & kv_store, & config. sync , https_config. clone ( ) ) {
195195 Ok ( sync_service) => Some ( Arc :: new ( sync_service) ) ,
196196 Err ( err) => {
197- error ! ( "Failed to create WaveKV sync service: {err}" ) ;
197+ error ! ( "Failed to create WaveKV sync service: {err:? }" ) ;
198198 None
199199 }
200200 }
@@ -212,7 +212,7 @@ impl ProxyInner {
212212 if let Some ( ref wavekv_sync) = wavekv_sync {
213213 info ! ( "WaveKV: bootstrapping from peers..." ) ;
214214 if let Err ( err) = wavekv_sync. bootstrap ( ) . await {
215- warn ! ( "WaveKV bootstrap failed: {err}" ) ;
215+ warn ! ( "WaveKV bootstrap failed: {err:? }" ) ;
216216 }
217217 }
218218
@@ -223,7 +223,7 @@ impl ProxyInner {
223223 let mut builder = CertStoreBuilder :: new ( ) ;
224224 for ( domain, data) in & all_cert_data {
225225 if let Err ( err) = builder. add_cert ( domain, data) {
226- warn ! ( "failed to load certificate for {}: {}" , domain , err ) ;
226+ warn ! ( "failed to load certificate for {domain }: {err:?}" ) ;
227227 }
228228 }
229229 cert_resolver. set ( Arc :: new ( builder. build ( ) ) ) ;
@@ -240,7 +240,7 @@ impl ProxyInner {
240240 ) ) ;
241241 // Initialize any configured domains
242242 if let Err ( err) = certbot. init_all ( ) . await {
243- warn ! ( "Failed to initialize multi-domain certbot: {}" , err ) ;
243+ warn ! ( "Failed to initialize multi-domain certbot: {err:?}" ) ;
244244 }
245245
246246 // Create TLS acceptors with CertResolver for SNI-based resolution
@@ -305,15 +305,15 @@ impl Proxy {
305305 let mut loaded = 0 ;
306306 for ( domain, data) in & all_cert_data {
307307 if let Err ( err) = builder. add_cert ( domain, data) {
308- warn ! ( "failed to reload certificate for {}: {}" , domain , err ) ;
308+ warn ! ( "failed to reload certificate for {domain }: {err:?}" ) ;
309309 } else {
310310 loaded += 1 ;
311311 }
312312 }
313313
314314 // Atomically replace the CertStore (no need to recreate acceptors)
315315 self . cert_resolver . set ( Arc :: new ( builder. build ( ) ) ) ;
316- info ! ( "CertStore: reloaded {} certificates from KvStore" , loaded ) ;
316+ info ! ( "CertStore: reloaded {loaded } certificates from KvStore" ) ;
317317 Ok ( ( ) )
318318 }
319319
@@ -405,7 +405,7 @@ impl Proxy {
405405 . new_client_by_id ( instance_id, app_id, client_public_key)
406406 . context ( "failed to allocate IP address for client" ) ?;
407407 if let Err ( err) = state. reconfigure ( ) {
408- error ! ( "failed to reconfigure: {}" , err ) ;
408+ error ! ( "failed to reconfigure: {err:?}" ) ;
409409 }
410410 let gateways = state. get_active_nodes ( ) ;
411411 let servers = gateways
@@ -470,7 +470,7 @@ fn start_recycle_thread(proxy: Proxy) {
470470 std:: thread:: spawn ( move || loop {
471471 std:: thread:: sleep ( proxy. config . recycle . interval ) ;
472472 if let Err ( err) = proxy. lock ( ) . recycle ( ) {
473- error ! ( "failed to run recycle: {err}" ) ;
473+ error ! ( "failed to run recycle: {err:? }" ) ;
474474 } ;
475475 } ) ;
476476}
@@ -484,7 +484,7 @@ async fn start_certbot_task(proxy: Proxy) {
484484 // Run once at startup to check for any pending renewals
485485 info ! ( "running initial certificate renewal check" ) ;
486486 if let Err ( err) = proxy. renew_cert ( None , false ) . await {
487- error ! ( "failed initial certificate renewal: {err}" ) ;
487+ error ! ( "failed initial certificate renewal: {err:? }" ) ;
488488 }
489489
490490 loop {
@@ -501,7 +501,7 @@ async fn start_certbot_task(proxy: Proxy) {
501501
502502 // Renew certificates
503503 if let Err ( err) = proxy. renew_cert ( None , false ) . await {
504- error ! ( "failed to renew certificates: {err}" ) ;
504+ error ! ( "failed to renew certificates: {err:? }" ) ;
505505 }
506506 }
507507 } ) ;
@@ -520,7 +520,7 @@ fn start_cert_store_watch_task(proxy: Proxy) {
520520 }
521521 info ! ( "WaveKV: detected certificate changes, reloading CertStore..." ) ;
522522 if let Err ( err) = proxy. reload_all_certs_from_kvstore ( ) {
523- error ! ( "Failed to reload certificates from KvStore: {err}" ) ;
523+ error ! ( "Failed to reload certificates from KvStore: {err:? }" ) ;
524524 }
525525 }
526526 } ) ;
@@ -577,7 +577,7 @@ fn start_zt_domain_watch_task(proxy: Proxy) {
577577 }
578578 }
579579 Err ( e) => {
580- warn ! ( "cert[{domain}]: auto-renewal failed: {e}" ) ;
580+ warn ! ( "cert[{domain}]: auto-renewal failed: {e:? }" ) ;
581581 }
582582 }
583583 } ) ;
@@ -620,7 +620,7 @@ fn start_bootnode_discovery_task(proxy: Proxy) {
620620 if let Err ( err) =
621621 fetch_peers_from_bootnode ( & bootnode, & kv_store, node_id, & https_config) . await
622622 {
623- debug ! ( "bootnode discovery retry failed: {err}" ) ;
623+ warn ! ( "bootnode discovery retry failed: {err:? }" ) ;
624624 } else {
625625 info ! ( "bootnode peer discovery succeeded" ) ;
626626 }
@@ -662,7 +662,7 @@ fn start_wavekv_watch_task(proxy: Proxy) -> Result<()> {
662662 }
663663 info ! ( "WaveKV: detected remote instance changes, reloading..." ) ;
664664 if let Err ( err) = reload_instances_from_kv_store ( & proxy_clone, & store_clone) {
665- error ! ( "Failed to reload instances from KvStore: {err}" ) ;
665+ error ! ( "Failed to reload instances from KvStore: {err:? }" ) ;
666666 }
667667 }
668668 } ) ;
@@ -680,7 +680,7 @@ fn start_wavekv_watch_task(proxy: Proxy) -> Result<()> {
680680 }
681681 info ! ( "WaveKV: detected remote node changes, reconfiguring WireGuard..." ) ;
682682 if let Err ( err) = proxy_for_nodes. lock ( ) . reconfigure ( ) {
683- error ! ( "Failed to reconfigure WireGuard: {err}" ) ;
683+ error ! ( "Failed to reconfigure WireGuard: {err:? }" ) ;
684684 }
685685 }
686686 } ) ;
@@ -696,7 +696,7 @@ fn start_wavekv_watch_task(proxy: Proxy) -> Result<()> {
696696 match kv_store_for_persist. persist_if_dirty ( ) {
697697 Ok ( true ) => info ! ( "WaveKV: periodic persist completed" ) ,
698698 Ok ( false ) => { } // No changes to persist
699- Err ( err) => error ! ( "WaveKV: periodic persist failed: {err}" ) ,
699+ Err ( err) => error ! ( "WaveKV: periodic persist failed: {err:? }" ) ,
700700 }
701701 }
702702 } ) ;
@@ -830,7 +830,7 @@ impl ProxyState {
830830 reg_time : encode_ts ( existing. reg_time ) ,
831831 } ;
832832 if let Err ( err) = self . kv_store . sync_instance ( & existing. id , & data) {
833- error ! ( "failed to sync existing instance to KvStore: {err}" ) ;
833+ error ! ( "failed to sync existing instance to KvStore: {err:? }" ) ;
834834 }
835835 return Some ( existing) ;
836836 }
@@ -859,7 +859,7 @@ impl ProxyState {
859859 reg_time : encode_ts ( info. reg_time ) ,
860860 } ;
861861 if let Err ( err) = self . kv_store . sync_instance ( & info. id , & data) {
862- error ! ( "failed to sync instance to KvStore: {err}" ) ;
862+ error ! ( "failed to sync instance to KvStore: {err:? }" ) ;
863863 }
864864
865865 self . state
@@ -888,7 +888,7 @@ impl ProxyState {
888888
889889 match cmd ! ( wg syncconf $ifname $config_path) {
890890 Ok ( _) => info ! ( "wg config updated" ) ,
891- Err ( e ) => error ! ( "failed to set wg config: {e }" ) ,
891+ Err ( err ) => error ! ( "failed to set wg config: {err:? }" ) ,
892892 }
893893 Ok ( ( ) )
894894 }
@@ -924,7 +924,7 @@ impl ProxyState {
924924 let handshakes = self . latest_handshakes ( None ) ;
925925 let mut instances = match handshakes {
926926 Err ( err) => {
927- warn ! ( "Failed to get handshakes, fallback to random selection: {err}" ) ;
927+ warn ! ( "Failed to get handshakes, fallback to random selection: {err:? }" ) ;
928928 return Ok ( self . random_select_a_host ( id) . unwrap_or_default ( ) ) ;
929929 }
930930 Ok ( handshakes) => app_instances
@@ -1039,7 +1039,7 @@ impl ProxyState {
10391039
10401040 // Sync deletion to KvStore
10411041 if let Err ( err) = self . kv_store . sync_delete_instance ( id) {
1042- error ! ( "Failed to sync instance deletion to KvStore: {err}" ) ;
1042+ error ! ( "Failed to sync instance deletion to KvStore: {err:? }" ) ;
10431043 }
10441044
10451045 self . state . allocated_addresses . remove ( & info. ip ) ;
@@ -1055,7 +1055,7 @@ impl ProxyState {
10551055 fn recycle ( & mut self ) -> Result < ( ) > {
10561056 // Refresh state: sync local handshakes to KvStore, update local last_seen from global
10571057 if let Err ( err) = self . refresh_state ( ) {
1058- warn ! ( "failed to refresh state: {err}" ) ;
1058+ warn ! ( "failed to refresh state: {err:? }" ) ;
10591059 }
10601060
10611061 // Note: Gateway nodes are not removed from KvStore, only marked offline/retired
@@ -1122,7 +1122,7 @@ impl ProxyState {
11221122 for ( pk, ( ts, _) ) in & handshakes {
11231123 if let Some ( & instance_id) = pk_to_id. get ( pk. as_str ( ) ) {
11241124 if let Err ( err) = self . kv_store . sync_instance_handshake ( instance_id, * ts) {
1125- debug ! ( "failed to sync instance handshake: {err}" ) ;
1125+ debug ! ( "failed to sync instance handshake: {err:? }" ) ;
11261126 }
11271127 }
11281128 }
@@ -1136,15 +1136,15 @@ impl ProxyState {
11361136 . kv_store
11371137 . sync_node_last_seen ( self . config . sync . node_id , now)
11381138 {
1139- debug ! ( "failed to sync node last_seen: {err}" ) ;
1139+ debug ! ( "failed to sync node last_seen: {err:? }" ) ;
11401140 }
11411141 Ok ( ( ) )
11421142 }
11431143
11441144 /// Sync connection count for an instance to KvStore
11451145 pub ( crate ) fn sync_connections ( & self , instance_id : & str , count : u64 ) {
11461146 if let Err ( err) = self . kv_store . sync_connections ( instance_id, count) {
1147- debug ! ( "Failed to sync connections: {err}" ) ;
1147+ debug ! ( "Failed to sync connections: {err:? }" ) ;
11481148 }
11491149 }
11501150
0 commit comments