blob: dfc69ca4b3d551f62da42ac93cb7667a70444acc [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
5namespace phosphor
6{
7namespace dump
8{
9namespace faultlog
10{
Claire Weinan919f71c2022-03-01 19:02:07 -080011
12void Entry::delete_()
13{
Dhruvaraj Subhashchandrand1f670f2023-06-05 22:19:25 -050014 lg2::info("In faultlog_dump_entry.cpp delete_()");
Claire Weinan919f71c2022-03-01 19:02:07 -080015
16 // Delete Dump file from Permanent location
17 try
18 {
19 std::filesystem::remove(file);
20 }
21 catch (const std::filesystem::filesystem_error& e)
22 {
23 // Log Error message and continue
Dhruvaraj Subhashchandrand1f670f2023-06-05 22:19:25 -050024 lg2::error("Failed to delete dump file, errormsg: {ERROR}", "ERROR", e);
Claire Weinan919f71c2022-03-01 19:02:07 -080025 }
26
27 // Remove Dump entry D-bus object
28 phosphor::dump::Entry::delete_();
29}
30
31} // namespace faultlog
32} // namespace dump
33} // namespace phosphor