-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLoggerHelper.cs
More file actions
29 lines (26 loc) · 1.04 KB
/
LoggerHelper.cs
File metadata and controls
29 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.Extensions.Logging;
namespace SqlDataIntegrationFunctionTriggerApp
{
/// <summary>
/// Convenience <see cref="ILogger"/> extensions with names mapped to specific log levels.
/// Note: these helpers do not control console colors; providers decide any coloring.
/// </summary>
public static class LoggerHelper
{
/// <summary>Logs using <see cref="LogLevel.Critical"/>.</summary>
public static void LogGrey(this ILogger logger, string message, params object?[] args)
{
logger.LogCritical(message, args);
}
/// <summary>Logs using <see cref="LogLevel.Error"/>.</summary>
public static void LogRed(this ILogger logger, string message, params object?[] args)
{
logger.LogError(message, args);
}
/// <summary>Logs using <see cref="LogLevel.Warning"/>.</summary>
public static void LogOrange(this ILogger logger, string message, params object?[] args)
{
logger.LogWarning(message, args);
}
}
}