Restart at record ID 1 after clearing the SEL

Since the record IDs are incremented only based on the last ID,
when the SEL is cleared, the next ID continues from where it was
before being cleared.

This change checks if the SEL has been cleared and resets the
stored ID so the next ID will start from 1 again.

Tested:
Added a SEL entry and checked the ID. Cleared the SEL and added
another SEL entry and confirmed that the ID restarted at 1.

Change-Id: I192441515e7502a9751db8023c06df0ba852ebac
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/src/sel_logger.cpp b/src/sel_logger.cpp
index 89eee7d..7fe52fb 100644
--- a/src/sel_logger.cpp
+++ b/src/sel_logger.cpp
@@ -100,6 +100,13 @@
 {
     static unsigned int recordId = initializeRecordId();
 
+    // If the log has been cleared, also clear the current ID
+    std::vector<std::filesystem::path> selLogFiles;
+    if (!getSELLogFiles(selLogFiles))
+    {
+        recordId = selInvalidRecID;
+    }
+
     if (++recordId >= selInvalidRecID)
     {
         recordId = 1;