From 69e4bdc5d71db313cdfef5717d1bdc0412789278 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Sat, 27 May 2023 13:13:41 -0700 Subject: [PATCH 1/2] Log OTP Listener This is for troubleshooting purposes, as some users report that it's not starting / doesn't receive, and this will always ensure we know it started. --- src/XIVLauncher/Windows/OtpInputDialog.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs b/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs index 8f6013ac..6f092a6e 100644 --- a/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs +++ b/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs @@ -54,7 +54,7 @@ public OtpInputDialog() { // Start Listen Task.Run(() => _otpListener.Start()); - Log.Debug("OTP server started..."); + Log.Information("OTP server started..."); } catch (Exception ex) { From e71d0d209628d78f2ab27fb3e6d446c6901f51f0 Mon Sep 17 00:00:00 2001 From: Robert Baker Date: Sat, 16 Dec 2023 13:26:40 -0800 Subject: [PATCH 2/2] Move logging to continuation --- src/XIVLauncher/Windows/OtpInputDialog.xaml.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs b/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs index 6f092a6e..35874136 100644 --- a/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs +++ b/src/XIVLauncher/Windows/OtpInputDialog.xaml.cs @@ -53,8 +53,14 @@ public OtpInputDialog() try { // Start Listen - Task.Run(() => _otpListener.Start()); - Log.Information("OTP server started..."); + Task otpListenerTask = Task.Run(() => _otpListener.Start()); + + otpListenerTask.ContinueWith(t => { + if (otpListenerTask.IsCompleted) Log.Information("OTP server started..."); + else if (otpListenerTask.IsCanceled) Log.Information("OTP server cancelled..."); + else if (otpListenerTask.IsFaulted) Log.Error(t.Exception, "OTP server could not be started..."); + }); + } catch (Exception ex) {