blob: 53a2087d6956ca7dd9ba1e2d159242d9594ef05a [file] [log] [blame]
Artem Senichevefd5d742018-10-24 16:14:04 +03001/**
2 * @brief Server side implementation of the D-Bus interface
3 *
4 * This file is part of HostLogger project.
5 *
6 * Copyright (c) 2018 YADRO
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21#include "dbus_server.hpp"
22#include <xyz/openbmc_project/Common/File/error.hpp>
23
24
25DbusServer::DbusServer(LogManager& logManager, sdbusplus::bus::bus& bus, const char* path /*= HOSTLOGGER_DBUS_PATH*/)
26: server_inherit(bus, path),
27 logManager_(logManager)
28{
29}
30
31
32void DbusServer::flush()
33{
34 const int rc = logManager_.flush();
35 if (rc != 0)
36 throw sdbusplus::xyz::openbmc_project::Common::File::Error::Write();
37}