diff --git a/src/Serilog/Log.cs b/src/Serilog/Log.cs index 32291ffb8..5e82c6872 100644 --- a/src/Serilog/Log.cs +++ b/src/Serilog/Log.cs @@ -108,14 +108,119 @@ public static void Write(LogEvent logEvent) /// Write a log event with the specified level. /// /// The level of the event. - /// - /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, string messageTemplate, T propertyValue) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, messageTemplate, new object[] { propertyValue }); + } + } + + /// + /// Write a log event with the specified level. + /// + /// The level of the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + } + } + + /// + /// Write a log event with the specified level. + /// + /// The level of the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + } + } + + /// + /// Write a log event with the specified level. + /// + /// The level of the event. + /// Message template describing the event. + /// Objects positionally formatted into the message template. [MessageTemplateFormatMethod("messageTemplate")] public static void Write(LogEventLevel level, string messageTemplate, params object[] propertyValues) { Logger.Write(level, messageTemplate, propertyValues); } + /// + /// Write a log event with the specified level and associated exception. + /// + /// The level of the event. + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, Exception exception, string messageTemplate, T propertyValue) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, exception, messageTemplate, new object[] { propertyValue }); + } + } + + /// + /// Write a log event with the specified level and associated exception. + /// + /// The level of the event. + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + } + } + + /// + /// Write a log event with the specified level and associated exception. + /// + /// The level of the event. + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + [MessageTemplateFormatMethod("messageTemplate")] + public static void Write(LogEventLevel level, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + // Avoid the array allocation and any boxing allocations when the level isn't enabled + if (Logger.IsEnabled(level)) + { + Logger.Write(level, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + } + } + /// /// Write a log event with the specified level and associated exception. /// @@ -139,9 +244,53 @@ public static bool IsEnabled(LogEventLevel level) { return Logger.IsEnabled(level); } + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose("Staring into space, wondering if we're alone."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Verbose, messageTemplate, propertyValue); + } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose("Staring into space, wondering if we're alone."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Verbose, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose("Staring into space, wondering if we're alone."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Verbose, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -154,6 +303,54 @@ public static void Verbose(string messageTemplate, params object[] propertyValue Logger.Verbose(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose(ex, "Staring into space, wondering where this comet came from."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Verbose, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose(ex, "Staring into space, wondering where this comet came from."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Verbose, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Verbose(ex, "Staring into space, wondering where this comet came from."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Verbose(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Verbose, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. /// @@ -170,7 +367,52 @@ public static void Verbose(Exception exception, string messageTemplate, params o } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Debug("Starting up at {StartedAt}.", DateTime.Now); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Debug, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Debug("Starting up at {StartedAt}.", DateTime.Now); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Debug, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Debug("Starting up at {StartedAt}.", DateTime.Now); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Debug, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -183,6 +425,54 @@ public static void Debug(string messageTemplate, params object[] propertyValues) Logger.Debug(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Debug(ex, "Swallowing a mundane exception."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Debug, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Debug(ex, "Swallowing a mundane exception."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Debug, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Debug(ex, "Swallowing a mundane exception."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Debug(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Debug, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. /// @@ -199,7 +489,52 @@ public static void Debug(Exception exception, string messageTemplate, params obj } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Information("Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Information, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Information("Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Information, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Information("Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Information, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -212,6 +547,54 @@ public static void Information(string messageTemplate, params object[] propertyV Logger.Information(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Information(ex, "Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Information, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Information(ex, "Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Information, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Information(ex, "Processed {RecordCount} records in {TimeMS}.", records.Length, sw.ElapsedMilliseconds); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Information(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Information, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. /// @@ -228,7 +611,52 @@ public static void Information(Exception exception, string messageTemplate, para } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Warning("Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Warning, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Warning("Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Warning, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Warning("Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Warning, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -241,6 +669,54 @@ public static void Warning(string messageTemplate, params object[] propertyValue Logger.Warning(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Warning(ex, "Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Warning, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Warning(ex, "Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Warning, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Warning(ex, "Skipped {SkipCount} records.", skippedRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Warning(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Warning, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. /// @@ -257,7 +733,52 @@ public static void Warning(Exception exception, string messageTemplate, params o } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Error("Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Error, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Error("Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Error, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Error("Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Error, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -270,6 +791,54 @@ public static void Error(string messageTemplate, params object[] propertyValues) Logger.Error(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Error(ex, "Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Error, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Error(ex, "Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Error, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Error(ex, "Failed {ErrorCount} records.", brokenRecords.Length); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Error(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Error, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. /// @@ -286,7 +855,52 @@ public static void Error(Exception exception, string messageTemplate, params obj } /// - /// Write a log event with the level and associated exception. + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal("Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Fatal, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal("Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Fatal, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level. + /// + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal("Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Fatal, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + + /// + /// Write a log event with the level. /// /// Message template describing the event. /// Objects positionally formatted into the message template. @@ -299,6 +913,54 @@ public static void Fatal(string messageTemplate, params object[] propertyValues) Logger.Fatal(messageTemplate, propertyValues); } + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal(ex, "Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(Exception exception, string messageTemplate, T propertyValue) + { + Write(LogEventLevel.Fatal, exception, messageTemplate, propertyValue); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal(ex, "Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + Write(LogEventLevel.Fatal, exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + /// Write a log event with the level and associated exception. + /// + /// Exception related to the event. + /// Message template describing the event. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// Object positionally formatted into the message template. + /// + /// Log.Fatal(ex, "Process terminating."); + /// + [MessageTemplateFormatMethod("messageTemplate")] + public static void Fatal(Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + Write(LogEventLevel.Fatal, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// /// Write a log event with the level and associated exception. ///