Completely remove LoggerExtensions

This commit is contained in:
Nikolaj
2020-09-16 10:27:21 +02:00
parent a18580c7f6
commit bd972e1be2
2 changed files with 2 additions and 21 deletions

View File

@@ -1,19 +0,0 @@
using System;
namespace Umbraco.Core.Logging
{
/// <summary>
/// Provides extension methods for the <see cref="ILogger"/> interface.
/// </summary>
public static class LoggerExtensions
{
/// <summary>
/// Determines if logging is enabled at a specified level, for a reporting type.
/// </summary>
/// <typeparam name="T">The reporting type.</typeparam>
/// <param name="logger">The logger.</param>
/// <param name="level">The level.</param>
public static bool IsEnabled<T>(this ILogger logger, LogLevel level)
=> logger.IsEnabled(typeof(T), level);
}
}

View File

@@ -43,14 +43,14 @@ namespace Umbraco.Core.Logging
public DisposableTimer DebugDuration<T>(string startMessage)
{
return Logger.IsEnabled<T>(LogLevel.Debug)
return Logger.IsEnabled(typeof(T), LogLevel.Debug)
? DebugDuration<T>(startMessage, "Completed.")
: null;
}
public DisposableTimer DebugDuration<T>(string startMessage, string completeMessage, string failMessage = null, int thresholdMilliseconds = 0)
{
return Logger.IsEnabled<T>(LogLevel.Debug)
return Logger.IsEnabled(typeof(T), LogLevel.Debug)
? new DisposableTimer(Logger, LogLevel.Debug, Profiler, typeof(T), startMessage, completeMessage, failMessage, thresholdMilliseconds)
: null;
}