Completely remove LoggerExtensions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user