blob: b04c0e399a7ef4bf31b39b9604e6f84bba65c89b [file] [log] [blame]
Adriana Kobylakf477fe22017-01-06 11:56:41 -06001#include <sdbusplus/bus.hpp>
2#include <sdbusplus/server/manager.hpp>
Deepak Kodihalli72654f12017-06-12 04:33:29 -05003#include <experimental/filesystem>
Adriana Kobylak8f7941e2016-11-14 14:46:23 -06004#include "config.h"
5#include "log_manager.hpp"
Adriana Kobylak8f7941e2016-11-14 14:46:23 -06006
7int main(int argc, char *argv[])
8{
Adriana Kobylakf477fe22017-01-06 11:56:41 -06009 auto bus = sdbusplus::bus::new_default();
10
Adriana Kobylak70bb6bc2017-02-21 19:51:52 -060011 // Add sdbusplus ObjectManager for the 'root' path of the logging manager.
12 sdbusplus::server::manager::manager objManager(bus, OBJ_LOGGING);
Adriana Kobylakf477fe22017-01-06 11:56:41 -060013
14 phosphor::logging::Manager manager(bus, OBJ_INTERNAL);
15
Deepak Kodihalli72654f12017-06-12 04:33:29 -050016 // Create a directory to persist errors.
17 std::experimental::filesystem::create_directories(ERRLOG_PERSIST_PATH);
18
19 // Recreate error d-bus objects from persisted errors.
20 manager.restore();
21
Adriana Kobylakf477fe22017-01-06 11:56:41 -060022 bus.request_name(BUSNAME_LOGGING);
23
Adriana Kobylakf477fe22017-01-06 11:56:41 -060024 while(true)
25 {
26 bus.process_discard();
27 bus.wait();
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060028 }
Adriana Kobylakf477fe22017-01-06 11:56:41 -060029
30 return 0;
Adriana Kobylak8f7941e2016-11-14 14:46:23 -060031}