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