Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 private void WriteUsage(LogDetail infoLog)
 {
     usageLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoLog);
 }
Exemplo n.º 3
0
 private void WritePerf(LogDetail infoLog)
 {
     perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoLog);
 }
Exemplo n.º 4
0
 public static void WriteError(LogDetail log)
 {
     ErrorLogger.Write(LogEventLevel.Error, "{@LogDetail}", log);
 }
Exemplo n.º 5
0
 public static void WritePerf(LogDetail log)
 {
     PerfLogger.Write(LogEventLevel.Information, "{@LogDetail}", log);
 }