Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Issue #3: Refactoring ILogger
Browse files Browse the repository at this point in the history
  • Loading branch information
sonjakhan committed Oct 6, 2014
1 parent a8e92e3 commit f609635
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 51 deletions.
80 changes: 79 additions & 1 deletion Logging.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.21901.1
VisualStudioVersion = 14.0.22115.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Framework.Logging", "src\Microsoft.Framework.Logging\Microsoft.Framework.Logging.kproj", "{19D1B6C5-8A62-4387-8816-C54874D1DF5F}"
EndProject
Expand All @@ -17,8 +17,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8C1F
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SampleApp", "samples\SampleApp\SampleApp.kproj", "{550E0247-0BDD-4016-A29B-250F075686FD}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Framework.Logging.Console", "src\Microsoft.Framework.Logging.Console\Microsoft.Framework.Logging.Console.kproj", "{75A4DE6D-BBAA-4D59-829D-94009E759A18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
aspnet50|Any CPU = aspnet50|Any CPU
aspnet50|Mixed Platforms = aspnet50|Mixed Platforms
aspnet50|x86 = aspnet50|x86
aspnetcore50|Any CPU = aspnetcore50|Any CPU
aspnetcore50|Mixed Platforms = aspnetcore50|Mixed Platforms
aspnetcore50|x86 = aspnetcore50|x86
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Expand All @@ -27,6 +35,16 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnet50|Any CPU.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnet50|Any CPU.Build.0 = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnet50|Mixed Platforms.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnet50|Mixed Platforms.Build.0 = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnet50|x86.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnetcore50|Any CPU.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnetcore50|Any CPU.Build.0 = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnetcore50|Mixed Platforms.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnetcore50|Mixed Platforms.Build.0 = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.aspnetcore50|x86.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -37,6 +55,16 @@ Global
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{19D1B6C5-8A62-4387-8816-C54874D1DF5F}.Release|x86.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnet50|Any CPU.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnet50|Any CPU.Build.0 = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnet50|Mixed Platforms.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnet50|Mixed Platforms.Build.0 = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnet50|x86.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnetcore50|Any CPU.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnetcore50|Any CPU.Build.0 = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnetcore50|Mixed Platforms.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnetcore50|Mixed Platforms.Build.0 = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.aspnetcore50|x86.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -47,6 +75,16 @@ Global
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{96B1D6A8-7E40-43C7-813F-898DC8192DDE}.Release|x86.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnet50|Any CPU.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnet50|Any CPU.Build.0 = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnet50|Mixed Platforms.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnet50|Mixed Platforms.Build.0 = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnet50|x86.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnetcore50|Any CPU.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnetcore50|Any CPU.Build.0 = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnetcore50|Mixed Platforms.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnetcore50|Mixed Platforms.Build.0 = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.aspnetcore50|x86.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -57,6 +95,16 @@ Global
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8221FA95-4B1A-44BF-925F-8AC1A317CC7C}.Release|x86.ActiveCfg = Release|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnet50|Any CPU.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnet50|Any CPU.Build.0 = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnet50|Mixed Platforms.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnet50|Mixed Platforms.Build.0 = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnet50|x86.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnetcore50|Any CPU.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnetcore50|Any CPU.Build.0 = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnetcore50|Mixed Platforms.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnetcore50|Mixed Platforms.Build.0 = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.aspnetcore50|x86.ActiveCfg = aspnet50|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -67,6 +115,16 @@ Global
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{718CBC9D-1E65-447D-A64A-7AC467FB5D6A}.Release|x86.ActiveCfg = Release|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnet50|Any CPU.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnet50|Any CPU.Build.0 = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnet50|Mixed Platforms.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnet50|Mixed Platforms.Build.0 = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnet50|x86.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnetcore50|Any CPU.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnetcore50|Any CPU.Build.0 = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnetcore50|Mixed Platforms.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnetcore50|Mixed Platforms.Build.0 = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.aspnetcore50|x86.ActiveCfg = aspnetcore50|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -77,6 +135,26 @@ Global
{550E0247-0BDD-4016-A29B-250F075686FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{550E0247-0BDD-4016-A29B-250F075686FD}.Release|x86.ActiveCfg = Release|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnet50|Any CPU.ActiveCfg = aspnet50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnet50|Any CPU.Build.0 = aspnet50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnet50|Mixed Platforms.ActiveCfg = aspnet50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnet50|Mixed Platforms.Build.0 = aspnet50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnet50|x86.ActiveCfg = aspnet50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnetcore50|Any CPU.ActiveCfg = aspnetcore50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnetcore50|Any CPU.Build.0 = aspnetcore50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnetcore50|Mixed Platforms.ActiveCfg = aspnetcore50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnetcore50|Mixed Platforms.Build.0 = aspnetcore50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.aspnetcore50|x86.ActiveCfg = aspnetcore50|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Debug|x86.ActiveCfg = Debug|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Release|Any CPU.Build.0 = Release|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{75A4DE6D-BBAA-4D59-829D-94009E759A18}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 7 additions & 3 deletions src/Microsoft.Framework.Logging.Interfaces/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ public interface ILogger
{
/// <summary>
/// Aggregates most logging patterns to a single method. This must be compatible with the Func representation in the OWIN environment.
///
/// To check IsEnabled call WriteCore with only TraceEventType and check the return value, no event will be written.
/// </summary>
/// <param name="eventType"></param>
/// <param name="eventId"></param>
/// <param name="state"></param>
/// <param name="exception"></param>
/// <param name="formatter"></param>
/// <returns></returns>
bool WriteCore(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter);
void Write(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter);

/// <summary>
/// Checks if the given TraceEventType is enabled.
/// </summary>
/// <param name="eventType"></param>
/// <returns></returns>
bool IsEnabled(TraceType eventType);

/// <summary>
/// Begins a logical operation scope.
Expand Down
23 changes: 11 additions & 12 deletions src/Microsoft.Framework.Logging.NLog/NLogLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,26 @@ public Logger(global::NLog.Logger logger)
_logger = logger;
}

public bool WriteCore(
public void Write(
TraceType eventType,
int eventId,
object state,
Exception exception,
Func<object, Exception, string> formatter)
{
var logLevel = GetLogLevel(eventType);
if (!_logger.IsEnabled(logLevel))
if (formatter != null)
{
return false;
var message = formatter(state, exception);
var eventInfo = LogEventInfo.Create(logLevel, _logger.Name, message, exception);
eventInfo.Properties["EventId"] = eventId;
_logger.Log(eventInfo);
}
if (formatter == null)
{
return true;
}
var message = formatter(state, exception);
var eventInfo = LogEventInfo.Create(logLevel, _logger.Name, message, exception);
eventInfo.Properties["EventId"] = eventId;
_logger.Log(eventInfo);
return true;
}

public bool IsEnabled(TraceType eventType)
{
return _logger.IsEnabled(GetLogLevel(eventType));
}

private LogLevel GetLogLevel(TraceType eventType)
Expand Down
15 changes: 8 additions & 7 deletions src/Microsoft.Framework.Logging/DiagnosticsLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ public DiagnosticsLogger(TraceSource traceSource)
_traceSource = traceSource;
}

public bool WriteCore(TraceType traceType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
public void Write(TraceType traceType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
{
var eventType = GetEventType(traceType);

if (!_traceSource.Switch.ShouldTrace(eventType))
{
return false;
}
else if (formatter != null)
if (formatter != null && _traceSource.Switch.ShouldTrace(eventType))
{
_traceSource.TraceEvent(eventType, eventId, formatter(state, exception));
}
return true;
}

public bool IsEnabled(TraceType traceType)
{
var eventType = GetEventType(traceType);
return _traceSource.Switch.ShouldTrace(eventType);
}

private static TraceEventType GetEventType(TraceType traceType)
Expand Down
19 changes: 15 additions & 4 deletions src/Microsoft.Framework.Logging/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,26 @@ public Logger(LoggerFactory loggerFactory, string name)
}
}

public bool WriteCore(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
public void Write(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
{
var result = false;
var count = _loggers.Length;
for (var index = 0; index != count; index++)
{
result |= _loggers[index].WriteCore(eventType, eventId, state, exception, formatter);
_loggers[index].Write(eventType, eventId, state, exception, formatter);
}
return result;
}

public bool IsEnabled(TraceType eventType)
{
var count = _loggers.Length;
for (var index = 0; index != count; index++)
{
if (!_loggers[index].IsEnabled(eventType))
{
return false;
}
}
return true;
}

public IDisposable BeginScope(object state)
Expand Down
32 changes: 8 additions & 24 deletions src/Microsoft.Framework.Logging/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@ public static class LoggerExtensions
private static readonly Func<object, Exception, string> TheMessage = (message, error) => (string)message;
private static readonly Func<object, Exception, string> TheMessageAndError = (message, error) => string.Format(CultureInfo.CurrentCulture, "{0}\r\n{1}", message, error);

/// <summary>
/// Checks if the given TraceEventType is enabled.
/// </summary>
/// <param name="logger"></param>
/// <param name="eventType"></param>
/// <returns></returns>
public static bool IsEnabled(this ILogger logger, TraceType eventType)
{
if (logger == null)
{
throw new ArgumentNullException("logger");
}

return logger.WriteCore(eventType, 0, null, null, null);
}

/// <summary>
/// Writes a verbose log message.
/// </summary>
Expand All @@ -44,7 +28,7 @@ public static void WriteVerbose(this ILogger logger, string data)
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Verbose, 0, data, null, TheMessage);
logger.Write(TraceType.Verbose, 0, data, null, TheMessage);
}

/// <summary>
Expand All @@ -59,7 +43,7 @@ public static void WriteInformation(this ILogger logger, string message)
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Information, 0, message, null, TheMessage);
logger.Write(TraceType.Information, 0, message, null, TheMessage);
}

/// <summary>
Expand All @@ -75,7 +59,7 @@ public static void WriteWarning(this ILogger logger, string message, params stri
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Warning, 0,
logger.Write(TraceType.Warning, 0,
string.Format(CultureInfo.InvariantCulture, message, args), null, TheMessage);
}

Expand All @@ -92,7 +76,7 @@ public static void WriteWarning(this ILogger logger, string message, Exception e
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Warning, 0, message, error, TheMessageAndError);
logger.Write(TraceType.Warning, 0, message, error, TheMessageAndError);
}

/// <summary>
Expand All @@ -107,7 +91,7 @@ public static void WriteError(this ILogger logger, string message)
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Error, 0, message, null, TheMessage);
logger.Write(TraceType.Error, 0, message, null, TheMessage);
}

/// <summary>
Expand All @@ -123,7 +107,7 @@ public static void WriteError(this ILogger logger, string message, Exception err
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Error, 0, message, error, TheMessageAndError);
logger.Write(TraceType.Error, 0, message, error, TheMessageAndError);
}

/// <summary>
Expand All @@ -138,7 +122,7 @@ public static void WriteCritical(this ILogger logger, string message)
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Critical, 0, message, null, TheMessage);
logger.Write(TraceType.Critical, 0, message, null, TheMessage);
}

/// <summary>
Expand All @@ -154,7 +138,7 @@ public static void WriteCritical(this ILogger logger, string message, Exception
throw new ArgumentNullException("logger");
}

logger.WriteCore(TraceType.Critical, 0, message, error, TheMessageAndError);
logger.Write(TraceType.Critical, 0, message, error, TheMessageAndError);
}
}
}
Loading

0 comments on commit f609635

Please sign in to comment.