blob: e5d9c8511d5687bc725bd07ccaf6ec14b58604a4 [file] [log] [blame]
Claire Weinan919f71c2022-03-01 19:02:07 -08001#include "faultlog_dump_entry.hpp"
2
Dhruvaraj Subhashchandrand1f670f2023-06-05 22:19:25 -05003#include <phosphor-logging/lg2.hpp>
Claire Weinan919f71c2022-03-01 19:02:07 -08004#include <phosphor-logging/log.hpp>
5
6namespace phosphor
7{
8namespace dump
9{
10namespace faultlog
11{
12using namespace phosphor::logging;
13
14void Entry::delete_()
15{
Dhruvaraj Subhashchandrand1f670f2023-06-05 22:19:25 -050016 lg2::info("In faultlog_dump_entry.cpp delete_()");
Claire Weinan919f71c2022-03-01 19:02:07 -080017
18 // Delete Dump file from Permanent location
19 try
20 {
21 std::filesystem::remove(file);
22 }
23 catch (const std::filesystem::filesystem_error& e)
24 {
25 // Log Error message and continue
Dhruvaraj Subhashchandrand1f670f2023-06-05 22:19:25 -050026 lg2::error("Failed to delete dump file, errormsg: {ERROR}", "ERROR", e);
Claire Weinan919f71c2022-03-01 19:02:07 -080027 }
28
29 // Remove Dump entry D-bus object
30 phosphor::dump::Entry::delete_();
31}
32
33} // namespace faultlog
34} // namespace dump
35} // namespace phosphor