diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-23 16:34:13 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-23 16:34:13 +0200 |
commit | 06d3dd584641baa1877a261f533cdb6a30e311ad (patch) | |
tree | 3267c55a2a65990b4b2d787903176316df03001c /jsonrpc | |
parent | f4818540c262350e0a27adb6a58652d0fe6b8943 (diff) |
jsonrpc: add info logs when connecting/listening to endpoint
Diffstat (limited to 'jsonrpc')
-rw-r--r-- | jsonrpc/src/client/mod.rs | 6 | ||||
-rw-r--r-- | jsonrpc/src/server/mod.rs | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/jsonrpc/src/client/mod.rs b/jsonrpc/src/client/mod.rs index 51f0233..43ce5fc 100644 --- a/jsonrpc/src/client/mod.rs +++ b/jsonrpc/src/client/mod.rs @@ -11,7 +11,7 @@ use std::{ }; use async_channel::{Receiver, Sender}; -use log::{debug, error}; +use log::{debug, error, info}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::json; @@ -191,6 +191,10 @@ impl Client { }); let conn = client.connect().await?; + info!( + "Successfully connected to the RPC server: {}", + conn.peer_endpoint()? + ); client.start_background_loop(conn); Ok(client) } diff --git a/jsonrpc/src/server/mod.rs b/jsonrpc/src/server/mod.rs index bde351e..8fa8a1c 100644 --- a/jsonrpc/src/server/mod.rs +++ b/jsonrpc/src/server/mod.rs @@ -6,7 +6,7 @@ pub mod service; use std::{collections::HashMap, sync::Arc}; -use log::{debug, error, trace, warn}; +use log::{debug, error, info, trace, warn}; use karyon_core::{ async_runtime::Executor, @@ -328,6 +328,8 @@ impl Server { None => TaskGroup::new(), }; let listener = Self::listen(&config).await?; + info!("RPC server listens to the endpoint: {}", config.endpoint); + let server = Arc::new(Server { listener, task_group, |