summaryrefslogtreecommitdiffstats
path: root/log_manager_main.cpp
blob: b04c0e399a7ef4bf31b39b9604e6f84bba65c89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/manager.hpp>
#include <experimental/filesystem>
#include "config.h"
#include "log_manager.hpp"

int main(int argc, char *argv[])
{
    auto bus = sdbusplus::bus::new_default();

    // Add sdbusplus ObjectManager for the 'root' path of the logging manager.
    sdbusplus::server::manager::manager objManager(bus, OBJ_LOGGING);

    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)
    {
        bus.process_discard();
        bus.wait();
    }

    return 0;
}
OpenPOWER on IntegriCloud