Skip to content

Improved logging for cas_client crate#537

Merged
hoytak merged 2 commits intomainfrom
hoytak/251023-logging-info-upgrades
Oct 24, 2025
Merged

Improved logging for cas_client crate#537
hoytak merged 2 commits intomainfrom
hoytak/251023-logging-info-upgrades

Conversation

@hoytak
Copy link
Collaborator

@hoytak hoytak commented Oct 24, 2025

This PR adds improved logging for the cas_client crate in light of the changes to log file capturing, upgrading a number of debug! calls to info! and adding begin and completion logging for all the remote operations. There should be no functionality changes.

Copy link
Contributor

@jgodlew jgodlew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good! Thanks for adding these logs.

A minor general nit would be to have the logs be more "structural" instead of embedding logging variables in the messages (e.g. instead of info!("request completed, status={status}"), use info!(status, "request completed"). It can make the logs easier for machine parsing. We don't need to block for this, but feel free to merge in: #538.

Copy link
Collaborator

@rajatarya rajatarya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly concerned about the logs being too verbose from logging each cache hit/miss and each CAS response, along with each reconstruction request start/end.

But, I think the value of having these for debugging/triaging issues is greater than the size of the logs (and the logs get cleaned anyway) so I think we should merge this!

hash,
};
if let Ok(Some(cached)) = cache.get(&key, &fetch_term.range).await.log_error("cache error") {
info!("Cache hit for hash {} range {:?}", hash, fetch_term.range);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be noisy. Cache hit & cache miss info! statements might be too verbose.

{
info!("Writing to local cache failed, continuing. Error: {}", e);
} else {
info!("Cache write successful for hash {} range {:?}", hash, fetch_term.range);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be too verbose as well.

let status_code = res.status().as_u16();
let request_id = request_id_from_response(res);
debug!(request_id, status_code, "Received CAS response");
info!(request_id, status_code, "Received CAS response");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really torn on this one - it does seem too verbose - but super useful when debugging

@hoytak hoytak merged commit 54aef80 into main Oct 24, 2025
6 checks passed
@hoytak hoytak deleted the hoytak/251023-logging-info-upgrades branch October 24, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants