diff options
Diffstat (limited to 'log_manager.cpp')
-rw-r--r-- | log_manager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/log_manager.cpp b/log_manager.cpp index bd36d66..fbf6682 100644 --- a/log_manager.cpp +++ b/log_manager.cpp @@ -217,12 +217,11 @@ void Manager::processMetadata(const std::string& errorName, void Manager::erase(uint32_t entryId) { auto entry = entries.find(entryId); - auto id = entry->second->id(); if(entries.end() != entry) { // Delete the persistent representation of this error. fs::path errorPath(ERRLOG_PERSIST_PATH); - errorPath /= std::to_string(id); + errorPath /= std::to_string(entryId); fs::remove(errorPath); if (entry->second->severity() >= Entry::sevLowerLimit) { @@ -234,6 +233,11 @@ void Manager::erase(uint32_t entryId) } entries.erase(entry); } + else + { + logging::log<level::ERR>("Invalid entry ID to delete", + logging::entry("ID=%d", entryId)); + } size_t realErrCnt = entries.size() - infoErrors.size(); |