Fixed Warnings
This commit is contained in:
@@ -41,13 +41,25 @@ public static class LoggerExtensions
|
||||
|
||||
public static void TestPattern(this ILogger logger, EventId eventId)
|
||||
{
|
||||
Exception exception = new Exception("Test Error Message");
|
||||
Exception exception = new InvalidDataException("Test Error Message");
|
||||
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Trace, "Trace Test Pattern");
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Debug, "Debug Test Pattern");
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Information, "Information Test Pattern");
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Warning, "Warning Test Pattern");
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Error, "Error Test Pattern", exception);
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
#pragma warning disable CA1848 // Use the LoggerMessage delegates
|
||||
logger.Emit(eventId, LogLevel.Critical, "Critical Test Pattern", exception);
|
||||
#pragma warning restore CA1848 // Use the LoggerMessage delegates
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user