Example #1
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Trace"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsTraceEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Trace) ?? false;
 }
Example #2
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Debug"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsDebugEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Debug) ?? false;
 }
Example #3
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Info"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsInfoEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Info) ?? false;
 }
Example #4
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Warning"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsWarningEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Warning) ?? false;
 }
Example #5
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Error"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsErrorEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Error) ?? false;
 }
Example #6
0
 /// <summary>
 /// Indicates whether logging is enabled at the <see cref="LogLevel.Fatal"/> level.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <returns>
 /// <c>true</c> if enabled, <c>false</c> if not.
 /// </returns>
 public static bool IsFatalEnabled(this ILogger logger)
 {
     return logger?.IsEnabled(LogLevel.Fatal) ?? false;
 }