public void Log(LogType type, LogDetail detail) { switch (type) { case LogType.PERFORMANCE: WritePerf(detail); break; case LogType.USAGE: WriteUsage(detail); break; case LogType.ERROR: WriteError(detail); break; case LogType.DIAGNOSTIC: WriteDiagnostic(detail); break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
private void WriteUsage(LogDetail infoLog) { usageLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoLog); }
private void WritePerf(LogDetail infoLog) { perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoLog); }
public static void WriteError(LogDetail log) { ErrorLogger.Write(LogEventLevel.Error, "{@LogDetail}", log); }
public static void WritePerf(LogDetail log) { PerfLogger.Write(LogEventLevel.Information, "{@LogDetail}", log); }