Skip to content

Commit

Permalink
chore(compile): log code cache file path (#26977)
Browse files Browse the repository at this point in the history
Ref #26976
  • Loading branch information
dsherret authored Nov 21, 2024
1 parent 8f7787f commit 45fad6a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cli/standalone/code_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ impl DenoCompileCodeCache {
// attempt to deserialize the cache data
match deserialize(&file_path, cache_key) {
Ok(data) => {
log::debug!("Loaded {} code cache entries", data.len());
log::debug!(
"Loaded {} code cache entries from {}",
data.len(),
file_path.display()
);
Self {
strategy: CodeCacheStrategy::SubsequentRun(
SubsequentRunCodeCacheStrategy {
Expand All @@ -53,7 +57,11 @@ impl DenoCompileCodeCache {
}
}
Err(err) => {
log::debug!("Failed to deserialize code cache: {:#}", err);
log::debug!(
"Failed to deserialize code cache from {}: {:#}",
file_path.display(),
err
);
Self {
strategy: CodeCacheStrategy::FirstRun(FirstRunCodeCacheStrategy {
cache_key,
Expand Down Expand Up @@ -186,6 +194,7 @@ impl FirstRunCodeCacheStrategy {
Ok(()) => {
if let Err(err) = std::fs::rename(&temp_file, &self.file_path) {
log::debug!("Failed to rename code cache: {}", err);
let _ = std::fs::remove_file(&temp_file);
} else {
log::debug!("Serialized {} code cache entries", count);
}
Expand Down

0 comments on commit 45fad6a

Please sign in to comment.