Skip to content

Commit

Permalink
jsonrpc: add info logs when connecting/listening to endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
hozan23 committed Jun 23, 2024
1 parent f481854 commit 06d3dd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion jsonrpc/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 3 additions & 1 deletion jsonrpc/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 06d3dd5

Please sign in to comment.