From 7200969bd66f6fdce4776294dae4d369bd146dc9 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 23 Mar 2023 13:50:43 +0100 Subject: [PATCH] chore(rpc): add debug to server config (#1926) --- crates/rpc/rpc-builder/src/lib.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index 973a6f46c0..1dab50a005 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -635,6 +635,20 @@ pub struct RpcServerConfig { ipc_endpoint: Option, } +impl fmt::Debug for RpcServerConfig { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("RpcServerConfig") + .field("http_server_config", &self.http_server_config) + .field("http_cors_domains", &self.http_cors_domains) + .field("http_addr", &self.http_addr) + .field("ws_server_config", &self.ws_server_config) + .field("ws_addr", &self.ws_addr) + .field("ipc_server_config", &self.ipc_server_config) + .field("ipc_endpoint", &self.ipc_endpoint.as_ref().map(|endpoint| endpoint.path())) + .finish() + } +} + /// === impl RpcServerConfig === impl RpcServerConfig { @@ -1022,8 +1036,8 @@ impl RpcServer { } } -impl std::fmt::Debug for RpcServer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Debug for RpcServer { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("RpcServer") .field("http", &self.http.is_some()) .field("ws", &self.ws.is_some())