blob: a2aa614c6fa2ee00ab345e0b8798c9c582db2765 [file] [log] [blame]
Artem Senicheve8837d52020-06-07 11:59:04 +03001// SPDX-License-Identifier: Apache-2.0
2// Copyright (C) 2020 YADRO
Artem Senichevefd5d742018-10-24 16:14:04 +03003
4#pragma once
5
Artem Senicheve8837d52020-06-07 11:59:04 +03006#include <cstddef>
7
8/**
9 * @struct Config
10 * @brief Configuration of the service, initialized with default values.
Artem Senichevefd5d742018-10-24 16:14:04 +030011 */
12struct Config
13{
Artem Senicheve8837d52020-06-07 11:59:04 +030014 /**
15 * @brief Constructor: load configuration from environment variables.
16 *
17 * @throw std::invalid_argument invalid format in one of the variables
18 */
19 Config();
Artem Senichevefd5d742018-10-24 16:14:04 +030020
Artem Senicheve8837d52020-06-07 11:59:04 +030021 /** @brief Socket ID used for connection with host console. */
22 const char* socketId = "";
23 /** @brief Max number of messages stored inside intermediate buffer. */
24 size_t bufMaxSize = 3000;
25 /** @brief Max age of messages (in minutes) inside intermediate buffer. */
26 size_t bufMaxTime = 0;
27 /** @brief Flag indicated we need to flush console buffer as it fills. */
28 bool bufFlushFull = false;
29 /** @brief Path to D-Bus object that provides host's state information. */
30 const char* hostState = "/xyz/openbmc_project/state/host0";
31 /** @brief Absolute path to the output directory for log files. */
32 const char* outDir = "/var/lib/obmc/hostlogs";
33 /** @brief Max number of log files in the output directory. */
34 size_t maxFiles = 10;
35};