mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
WPF: Update sentry config
This commit is contained in:
parent
1eb71c66e0
commit
b931e24523
|
@ -466,12 +466,15 @@ namespace BililiveRecorder.Core
|
|||
{
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
// 定时主动检查不需要错误重试
|
||||
try
|
||||
{
|
||||
// 定时主动检查不需要错误重试
|
||||
await this.FetchRoomInfoAsync().ConfigureAwait(false);
|
||||
|
||||
await this.FetchRoomInfoAsync().ConfigureAwait(false);
|
||||
|
||||
if (this.Streaming && this.AutoRecordForThisSession && this.RoomConfig.AutoRecord)
|
||||
this.CreateAndStartNewRecordTask();
|
||||
if (this.Streaming && this.AutoRecordForThisSession && this.RoomConfig.AutoRecord)
|
||||
this.CreateAndStartNewRecordTask();
|
||||
}
|
||||
catch (Exception) { }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace BililiveRecorder.WPF
|
|||
levelSwitchConsole = new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Error);
|
||||
logger = BuildLogger();
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
Log.Logger = logger;
|
||||
SentrySdk.ConfigureScope(s =>
|
||||
{
|
||||
|
@ -153,9 +154,10 @@ namespace BililiveRecorder.WPF
|
|||
.WriteTo.File(new CompactJsonFormatter(), "./logs/bilirec.txt", shared: true, rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true)
|
||||
.WriteTo.Sentry(o =>
|
||||
{
|
||||
o.Dsn = "https://7c6c5da3140543809661813aaa836207@o210546.ingest.sentry.io/5556540";
|
||||
o.Dsn = "https://ecd9c92010ad47e7a787bb8fc47281e3@o210546.ingest.sentry.io/5556540";
|
||||
|
||||
o.DisableAppDomainUnhandledExceptionCapture();
|
||||
o.DisableTaskUnobservedTaskExceptionCapture();
|
||||
o.AddExceptionFilterForType<System.Net.Http.HttpRequestException>();
|
||||
|
||||
o.MinimumBreadcrumbLevel = Serilog.Events.LogEventLevel.Debug;
|
||||
|
@ -179,6 +181,10 @@ namespace BililiveRecorder.WPF
|
|||
logger.Fatal(ex, "Unhandled exception from Application.UnhandledException");
|
||||
}
|
||||
|
||||
[HandleProcessCorruptedStateExceptions, SecurityCritical]
|
||||
private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) =>
|
||||
logger.Error(e.Exception, "Unobserved exception from TaskScheduler.UnobservedTaskException");
|
||||
|
||||
[HandleProcessCorruptedStateExceptions, SecurityCritical]
|
||||
private static void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) =>
|
||||
logger.Fatal(e.Exception, "Unhandled exception from AppDomain.DispatcherUnhandledException");
|
||||
|
|
Loading…
Reference in New Issue
Block a user