From 140bc3d97c023afeaf4289fb05bdbd9fb11bc097 Mon Sep 17 00:00:00 2001 From: VahidN Date: Sun, 31 Mar 2024 12:48:11 +0330 Subject: [PATCH] Update README.md --- README.md | 55 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 7329998..13302b4 100644 --- a/README.md +++ b/README.md @@ -593,30 +593,37 @@ Or ... you can use the second optional parameter of the `DisableLogging` method ```c# .DisableLogging(disable: !environment.IsDevelopment(), cacheableEvent: args => { - switch (args.EventId) - { - case CacheableLogEventId.CacheHit: - break; - case CacheableLogEventId.QueryResultCached: - break; - case CacheableLogEventId.QueryResultInvalidated: - break; - case CacheableLogEventId.CachingSkipped: - break; - case CacheableLogEventId.InvalidationSkipped: - break; - case CacheableLogEventId.CachingSystemStarted: - break; - case CacheableLogEventId.CachingError: - break; - case CacheableLogEventId.QueryResultSuppressed: - break; - case CacheableLogEventId.CacheDependenciesCalculated: - break; - case CacheableLogEventId.CachePolicyCalculated: - break; - } - Console.WriteLine($"{args.EventId} -> {args.Message}"); + switch (args.EventId) + { + case CacheableLogEventId.CacheHit: + break; + case CacheableLogEventId.QueryResultCached: + break; + case CacheableLogEventId.QueryResultInvalidated: + Console.ForegroundColor = ConsoleColor.Green; + Console.WriteLine($"{Environment.NewLine}{args.EventId} -> {args.Message}"); + + break; + case CacheableLogEventId.CachingSkipped: + break; + case CacheableLogEventId.InvalidationSkipped: + break; + case CacheableLogEventId.CachingSystemStarted: + break; + case CacheableLogEventId.CachingError: + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"{Environment.NewLine}{args.EventId} -> {args.Message}"); + + break; + case CacheableLogEventId.QueryResultSuppressed: + break; + case CacheableLogEventId.CacheDependenciesCalculated: + break; + case CacheableLogEventId.CachePolicyCalculated: + break; + } + + Console.ResetColor(); }) ```