From 6ebd3b82b6ead0d918d182434a97c4f44bf893ee Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 2 Nov 2022 13:36:00 +0100 Subject: [PATCH] Messaging: Improve logging --- Messaging/Limilab.vb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Messaging/Limilab.vb b/Messaging/Limilab.vb index fc583368..69bca208 100644 --- a/Messaging/Limilab.vb +++ b/Messaging/Limilab.vb @@ -113,17 +113,21 @@ Public Class Limilab End Try End Function Public Function IMAPGetMessageIDs_AllMails() As List(Of Long) - Dim oListuids As New List(Of Long) Logger.Debug("Starting IMAPGetMessageIDs ...") If Initialized = False Then Return Nothing End If Try - Dim oConnect As Boolean = ImapConnect() + Dim oConnectionSuccessful As Boolean = ImapConnect() + Dim oListuids As List(Of Long) - If oConnect = True Then + If oConnectionSuccessful = True Then + Logger.Debug("Checking for new messages..") oListuids = ImapGetMessageIDs_All() CURR_ListUIDs = oListuids + Else + Logger.Warn("Connection was NOT successful. Returning Nothing.") + Return Nothing End If Return oListuids Catch ex As Exception @@ -223,10 +227,13 @@ Public Class Limilab Private Function ImapGetMessageIDs_All() As List(Of Long) Dim oListuids As New List(Of Long) Try + Logger.Debug("Opening Inbox..") CurrentImapObject.SelectInbox() + Logger.Debug("Searching messages..") oListuids = CurrentImapObject.Search(Flag.All) + Logger.Debug("[{0}] messages found.", oListuids.Count) Return oListuids Catch ex As Exception Logger.Error(ex)