blob: 36a3fb27255c1830d907f36731823d05b4fb8584 [file] [log] [blame]
Adriana Kobylak88d7cf82017-01-24 12:30:15 -06001#include "elog_entry.hpp"
Patrick Venturef18bf832018-10-26 18:14:00 -07002
Deepak Kodihalli97431892017-06-12 09:14:57 -05003#include "elog_serialize.hpp"
Patrick Venturef18bf832018-10-26 18:14:00 -07004#include "log_manager.hpp"
Adriana Kobylak88d7cf82017-01-24 12:30:15 -06005
6namespace phosphor
7{
8namespace logging
9{
10
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060011// TODO Add interfaces to handle the error log id numbering
12
Deepak Kodihalli36db46c2017-03-31 06:28:44 -050013void Entry::delete_()
14{
15 parent.erase(id());
16}
17
Deepak Kodihalli97431892017-06-12 09:14:57 -050018bool Entry::resolved(bool value)
19{
Patrick Venturef18bf832018-10-26 18:14:00 -070020 auto current =
21 sdbusplus::xyz::openbmc_project::Logging::server::Entry::resolved();
Deepak Kodihalli97431892017-06-12 09:14:57 -050022 if (value != current)
23 {
Patrick Venturef18bf832018-10-26 18:14:00 -070024 value ? associations({}) : associations(assocs);
25 current =
26 sdbusplus::xyz::openbmc_project::Logging::server::Entry::resolved(
27 value);
Matt Spinler1e71a4d2020-03-04 13:40:22 -060028
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 Kodihalli97431892017-06-12 09:14:57 -050034 serialize(*this);
35 }
36
37 return current;
38}
39
Adriana Kobylak88d7cf82017-01-24 12:30:15 -060040} // namespace logging
Patrick Venturef18bf832018-10-26 18:14:00 -070041} // namespace phosphor