Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 1 | #include <sdbusplus/bus.hpp> |
| 2 | #include <sdbusplus/server/manager.hpp> |
Deepak Kodihalli | 72654f1 | 2017-06-12 04:33:29 -0500 | [diff] [blame] | 3 | #include <experimental/filesystem> |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 4 | #include "config.h" |
| 5 | #include "log_manager.hpp" |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 6 | |
| 7 | int main(int argc, char *argv[]) |
| 8 | { |
Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 9 | auto bus = sdbusplus::bus::new_default(); |
| 10 | |
Adriana Kobylak | 70bb6bc | 2017-02-21 19:51:52 -0600 | [diff] [blame] | 11 | // Add sdbusplus ObjectManager for the 'root' path of the logging manager. |
| 12 | sdbusplus::server::manager::manager objManager(bus, OBJ_LOGGING); |
Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 13 | |
| 14 | phosphor::logging::Manager manager(bus, OBJ_INTERNAL); |
| 15 | |
Deepak Kodihalli | 72654f1 | 2017-06-12 04:33:29 -0500 | [diff] [blame] | 16 | // 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 Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 22 | bus.request_name(BUSNAME_LOGGING); |
| 23 | |
Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 24 | while(true) |
| 25 | { |
| 26 | bus.process_discard(); |
| 27 | bus.wait(); |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 28 | } |
Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 29 | |
| 30 | return 0; |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 31 | } |