Further improvement to logging formatting and readability

This commit is contained in:
2026-01-25 09:11:45 -07:00
parent 82441d5247
commit 9bddc59fe2
2 changed files with 22 additions and 16 deletions

View File

@@ -19,7 +19,8 @@ public class MovieHelper(ILogger logger)
{
ArgumentNullException.ThrowIfNull(movie, "IsMovieStale process recieved a null movie. Logic failure. Exception thrown.");
_loggingHelper.LogDebugInformation("Start of scanning for movie: {Movie}", movie);
_loggingHelper.LogDebugInformation("-------------------------------------------------");
_loggingHelper.LogDebugInformation("Scanning movie: {Movie}", movie);
_loggingHelper.LogDebugInformation("-------------------------------------------------");
bool movieIsStale = false;

View File

@@ -81,30 +81,19 @@ public sealed class StaleMediaTask : IScheduledTask
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Starting scan of series items.");
_loggingHelper.LogInformation("-------------------------------------------------");
List<BaseItem> staleSeasons = [.. series.SelectMany(GetStaleSeasons)];
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Starting scan of movies items.");
_loggingHelper.LogInformation("End of scan for series items.");
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Starting scan of movie items.");
List<BaseItem> staleMovies = [.. GetStaleMovies(movies)];
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Stale Movies found: {StaleMovies}", staleMovies.Count);
if (staleMovies.Count > 0)
{
foreach (var movieInfo in staleMovies)
{
_loggingHelper.LogInformation("Movie Info: ID: {Id} | Movie Name: {MovieName}", [movieInfo.Id, movieInfo.Name]);
}
}
else
{
_loggingHelper.LogInformation("No stale movies found!");
}
_loggingHelper.LogInformation("End of scan for movie items.");
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Stale seasons found: {StaleSeasons}", staleSeasons.Count);
@@ -123,6 +112,21 @@ public sealed class StaleMediaTask : IScheduledTask
_loggingHelper.LogInformation("No stale seasons found!");
}
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Stale Movies found: {StaleMovies}", staleMovies.Count);
if (staleMovies.Count > 0)
{
foreach (var movieInfo in staleMovies)
{
_loggingHelper.LogInformation("Movie Info: ID: {Id} | Movie Name: {MovieName}", [movieInfo.Id, movieInfo.Name]);
}
}
else
{
_loggingHelper.LogInformation("No stale movies found!");
}
_loggingHelper.LogInformation("-------------------------------------------------");
_loggingHelper.LogInformation("Ending stale media scan...");
_loggingHelper.LogInformation("-------------------------------------------------");
@@ -150,6 +154,7 @@ public sealed class StaleMediaTask : IScheduledTask
private List<BaseItem> GetStaleSeasons(BaseItem item)
{
_loggingHelper.LogDebugInformation("-------------------------------------------------");
_loggingHelper.LogDebugInformation("Debug data for series: {SeriesName}", item.Name);
_loggingHelper.LogDebugInformation("-------------------------------------------------");