diff options
author | Deepak Kodihalli <dkodihal@in.ibm.com> | 2017-06-12 04:33:29 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-06-26 02:33:34 +0000 |
commit | 72654f10e45056ab55b77d835e2bfd01e8d98480 (patch) | |
tree | a81c82f786690244abf0a8be2185e6c775cabac5 /log_manager_main.cpp | |
parent | 979632aeb629b4cb62aed276f7422c34cd7983bc (diff) | |
download | phosphor-logging-72654f10e45056ab55b77d835e2bfd01e8d98480.tar.gz phosphor-logging-72654f10e45056ab55b77d835e2bfd01e8d98480.zip |
Persist error d-bus objects
Use Cereal to implement serialization and de-serialization of
properties of error d-bus objects.
Serialize and persist error d-bus objects as they are put on the bus.
De-serialize and restore them (if persistent ones exist) when
phosphor-log-manager starts up.
Change-Id: I1f5df1abbe74bfdb86e3e82a78ff7115e90e2112
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'log_manager_main.cpp')
-rw-r--r-- | log_manager_main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/log_manager_main.cpp b/log_manager_main.cpp index a3b26a3..b04c0e3 100644 --- a/log_manager_main.cpp +++ b/log_manager_main.cpp @@ -1,5 +1,6 @@ #include <sdbusplus/bus.hpp> #include <sdbusplus/server/manager.hpp> +#include <experimental/filesystem> #include "config.h" #include "log_manager.hpp" @@ -12,6 +13,12 @@ int main(int argc, char *argv[]) phosphor::logging::Manager manager(bus, OBJ_INTERNAL); + // Create a directory to persist errors. + std::experimental::filesystem::create_directories(ERRLOG_PERSIST_PATH); + + // Recreate error d-bus objects from persisted errors. + manager.restore(); + bus.request_name(BUSNAME_LOGGING); while(true) |