Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 1 | #include "elog_entry.hpp" |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 2 | |
Deepak Kodihalli | 9743189 | 2017-06-12 09:14:57 -0500 | [diff] [blame] | 3 | #include "elog_serialize.hpp" |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 4 | #include "log_manager.hpp" |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace logging |
| 9 | { |
| 10 | |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 11 | // TODO Add interfaces to handle the error log id numbering |
| 12 | |
Deepak Kodihalli | 36db46c | 2017-03-31 06:28:44 -0500 | [diff] [blame] | 13 | void Entry::delete_() |
| 14 | { |
| 15 | parent.erase(id()); |
| 16 | } |
| 17 | |
Deepak Kodihalli | 9743189 | 2017-06-12 09:14:57 -0500 | [diff] [blame] | 18 | bool Entry::resolved(bool value) |
| 19 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 20 | auto current = |
| 21 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::resolved(); |
Deepak Kodihalli | 9743189 | 2017-06-12 09:14:57 -0500 | [diff] [blame] | 22 | if (value != current) |
| 23 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 24 | value ? associations({}) : associations(assocs); |
| 25 | current = |
| 26 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::resolved( |
| 27 | value); |
Matt Spinler | 1e71a4d | 2020-03-04 13:40:22 -0600 | [diff] [blame] | 28 | |
| 29 | uint64_t ms = std::chrono::duration_cast<std::chrono::milliseconds>( |
| 30 | std::chrono::system_clock::now().time_since_epoch()) |
| 31 | .count(); |
| 32 | updateTimestamp(ms); |
| 33 | |
Deepak Kodihalli | 9743189 | 2017-06-12 09:14:57 -0500 | [diff] [blame] | 34 | serialize(*this); |
| 35 | } |
| 36 | |
| 37 | return current; |
| 38 | } |
| 39 | |
Adriana Kobylak | 88d7cf8 | 2017-01-24 12:30:15 -0600 | [diff] [blame] | 40 | } // namespace logging |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 41 | } // namespace phosphor |