blob: 897d98b689cba57e592472da9ee45baef39ffad9 [file] [log] [blame]
Claire Weinan919f71c2022-03-01 19:02:07 -08001#include "faultlog_dump_entry.hpp"
2
3#include <fmt/core.h>
4
5#include <phosphor-logging/log.hpp>
6
7namespace phosphor
8{
9namespace dump
10{
11namespace faultlog
12{
13using namespace phosphor::logging;
14
15void Entry::delete_()
16{
17 log<level::INFO>("In faultlog_dump_entry.cpp delete_()");
18
19 // Delete Dump file from Permanent location
20 try
21 {
22 std::filesystem::remove(file);
23 }
24 catch (const std::filesystem::filesystem_error& e)
25 {
26 // Log Error message and continue
27 log<level::ERR>(
28 fmt::format("Failed to delete dump file, errormsg({})", e.what())
29 .c_str());
30 }
31
32 // Remove Dump entry D-bus object
33 phosphor::dump::Entry::delete_();
34}
35
36} // namespace faultlog
37} // namespace dump
38} // namespace phosphor