Skip to content

Commit

Permalink
Improved client logs (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul authored Jul 3, 2024
1 parent b381062 commit 1e07acc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions redis/src/aio/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use std::net::{IpAddr, SocketAddr};
use std::pin::Pin;
#[cfg(any(feature = "tokio-comp", feature = "async-std-comp"))]
use tokio_util::codec::Decoder;
use tracing::info;

/// Represents a stateful redis TCP connection.
#[deprecated(note = "aio::Connection is deprecated. Use aio::MultiplexedConnection instead.")]
Expand Down Expand Up @@ -451,6 +452,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
ConnectionAddr::Tcp(ref host, port) => {
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
info!("IP of node {:?} is {:?}", host, socket_addr.ip());
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp(socket_addr).await?,
Expand All @@ -477,6 +479,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
}
let socket_addrs = get_socket_addrs(host, port).await?;
select_ok(socket_addrs.map(|socket_addr| {
info!("IP of node {:?} is {:?}", host, socket_addr.ip());
Box::pin(async move {
Ok::<_, RedisError>((
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
Expand Down
3 changes: 2 additions & 1 deletion redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ impl<C> Future for Request<C> {
.into();
}
};
trace!("Request error `{}` on node `{:?}", err, address);

warn!("Received request error {} on node {:?}.", err, address);

match err.retry_method() {
crate::types::RetryMethod::AskRedirect => {
Expand Down

0 comments on commit 1e07acc

Please sign in to comment.