blob: aba7694c05a9872cc75f55cd7a193c46846703c3 [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"
Patrick Venture4d5a5dc2018-11-14 08:51:13 -080022
Artem Senichevefd5d742018-10-24 16:14:04 +030023#include <xyz/openbmc_project/Common/File/error.hpp>
24
Patrick Venture4d5a5dc2018-11-14 08:51:13 -080025DbusServer::DbusServer(LogManager& logManager, sdbusplus::bus::bus& bus,
26 const char* path /*= HOSTLOGGER_DBUS_PATH*/) :
27 server_inherit(bus, path),
28 logManager_(logManager)
Artem Senichevefd5d742018-10-24 16:14:04 +030029{
30}
31
Artem Senichevefd5d742018-10-24 16:14:04 +030032void DbusServer::flush()
33{
34 const int rc = logManager_.flush();
35 if (rc != 0)
36 throw sdbusplus::xyz::openbmc_project::Common::File::Error::Write();
37}