Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 1 | #include "faultlog_dump_entry.hpp" |
| 2 | |
Dhruvaraj Subhashchandran | d1f670f | 2023-06-05 22:19:25 -0500 | [diff] [blame] | 3 | #include <phosphor-logging/lg2.hpp> |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 4 | #include <phosphor-logging/log.hpp> |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace dump |
| 9 | { |
| 10 | namespace faultlog |
| 11 | { |
| 12 | using namespace phosphor::logging; |
| 13 | |
| 14 | void Entry::delete_() |
| 15 | { |
Dhruvaraj Subhashchandran | d1f670f | 2023-06-05 22:19:25 -0500 | [diff] [blame] | 16 | lg2::info("In faultlog_dump_entry.cpp delete_()"); |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 17 | |
| 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 Subhashchandran | d1f670f | 2023-06-05 22:19:25 -0500 | [diff] [blame] | 26 | lg2::error("Failed to delete dump file, errormsg: {ERROR}", "ERROR", e); |
Claire Weinan | 919f71c | 2022-03-01 19:02:07 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | // Remove Dump entry D-bus object |
| 30 | phosphor::dump::Entry::delete_(); |
| 31 | } |
| 32 | |
| 33 | } // namespace faultlog |
| 34 | } // namespace dump |
| 35 | } // namespace phosphor |