Skip to content

Commit 782790b

Browse files
committed
Reduce DiskCache routine log messages from Debug to Trace
1 parent 91ee0cf commit 782790b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Aspire.Cli/Caching/DiskCache.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ private static TimeSpan ReadWindow(IConfiguration configuration, string key, Tim
6060
var cacheFilePath = ResolveValidCacheFile(keyHash);
6161
if (cacheFilePath is null)
6262
{
63-
_logger.LogDebug("Disk cache miss for key {RawKey}", key);
63+
_logger.LogTrace("Disk cache miss for key {RawKey}", key);
6464
return null;
6565
}
6666

6767
// Assuming here is a hit we attempt to read the file and return the string.
68-
_logger.LogDebug("Disk cache hit for key {RawKey} (file: {CacheFilePath})", key, cacheFilePath);
68+
_logger.LogTrace("Disk cache hit for key {RawKey} (file: {CacheFilePath})", key, cacheFilePath);
6969
return await File.ReadAllTextAsync(cacheFilePath, cancellationToken).ConfigureAwait(false);
7070
}
7171
catch (Exception ex)
@@ -120,7 +120,7 @@ public async Task SetAsync(string key, string content, CancellationToken cancell
120120
}
121121

122122
File.Move(tempFile, fullPath);
123-
_logger.LogDebug("Stored disk cache entry for key {RawKey} (file: {CacheFilePath})", key, fullPath);
123+
_logger.LogTrace("Stored disk cache entry for key {RawKey} (file: {CacheFilePath})", key, fullPath);
124124
}
125125
catch (Exception ex)
126126
{
@@ -270,19 +270,19 @@ private void TryDelete(FileInfo file, bool expired = false, bool old = false, bo
270270
file.Delete();
271271
if (expired)
272272
{
273-
_logger.LogDebug("Deleted expired cache file: {CacheFile}", file.FullName);
273+
_logger.LogTrace("Deleted expired cache file: {CacheFile}", file.FullName);
274274
}
275275
else if (old)
276276
{
277-
_logger.LogDebug("Deleted old cache file during global cleanup: {CacheFile}", file.FullName);
277+
_logger.LogTrace("Deleted old cache file during global cleanup: {CacheFile}", file.FullName);
278278
}
279279
else if (invalid)
280280
{
281-
_logger.LogDebug("Deleted invalid cache file: {CacheFile}", file.FullName);
281+
_logger.LogTrace("Deleted invalid cache file: {CacheFile}", file.FullName);
282282
}
283283
else
284284
{
285-
_logger.LogDebug("Deleted cache file: {CacheFile}", file.FullName);
285+
_logger.LogTrace("Deleted cache file: {CacheFile}", file.FullName);
286286
}
287287
}
288288
catch (Exception ex)

0 commit comments

Comments
 (0)