feat: print all logged exceptions via Troubleshooting

This commit is contained in:
goat 2021-09-17 04:09:38 +02:00
parent 25a71574cf
commit 59ba3bdd07
No known key found for this signature in database
GPG key ID: F18F057873895461
3 changed files with 16 additions and 5 deletions

View file

@ -53,7 +53,7 @@ namespace Dalamud.Interface.Internal.Windows
this.autoScroll = configuration.LogAutoScroll;
this.openAtStartup = configuration.LogOpenAtStartup;
SerilogEventSink.Instance.OnLogLine += this.OnLogLine;
SerilogEventSink.Instance.LogLine += this.OnLogLine;
this.Size = new Vector2(500, 400);
this.SizeCondition = ImGuiCond.FirstUseEver;
@ -68,7 +68,7 @@ namespace Dalamud.Interface.Internal.Windows
/// </summary>
public void Dispose()
{
SerilogEventSink.Instance.OnLogLine -= this.OnLogLine;
SerilogEventSink.Instance.LogLine -= this.OnLogLine;
}
/// <summary>
@ -476,7 +476,7 @@ namespace Dalamud.Interface.Internal.Windows
_ => throw new ArgumentOutOfRangeException(level.ToString(), "Invalid LogEventLevel"),
};
private void OnLogLine(object sender, (string Line, LogEventLevel Level, DateTimeOffset Offset) logEvent)
private void OnLogLine(object sender, (string Line, LogEventLevel Level, DateTimeOffset Offset, Exception? Exception) logEvent)
{
this.HandleLogLine(logEvent.Line, logEvent.Level, logEvent.Offset);
}