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