summaryrefslogtreecommitdiffhomepage
path: root/config.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-07 14:07:13 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-07 14:07:13 +0100
commit63fc8e14be5e450df8ccc18fe76e02c5f0827660 (patch)
treed1e37837b277b75e0eb9289b41a47f5dc86b4360 /config.cpp
parent7feaf1a9d7fb09985b9b17cd48fd1aa8eb15d8b3 (diff)
Test statistics
Diffstat (limited to 'config.cpp')
-rw-r--r--config.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/config.cpp b/config.cpp
index 342d973..2b37f91 100644
--- a/config.cpp
+++ b/config.cpp
@@ -45,6 +45,8 @@ void Config::readConfigfile(const std::filesystem::path& filename)
m_threads = tree.get<int>("webserver.threads");
+ m_statistics_path = tree.get<std::string>("webserver.statisticspath", "/var/lib/webserver/stats.db");
+
// optional entries
auto elements = tree.get_child_optional("webserver");
if (elements) {
@@ -226,6 +228,11 @@ int Config::Threads() const
return m_threads;
}
+fs::path Config::statistics_path() const
+{
+ return m_statistics_path;
+}
+
const std::vector<std::string>& Config::PluginDirectories() const
{
return m_plugin_directories;
@@ -245,10 +252,12 @@ void Config::dump() const
{
std::cout << "=== Configuration ===========================" << std::endl;
std::cout << "User: " << m_user << std::endl;
- std::cout << "Group: " << m_user << std::endl;
+ std::cout << "Group: " << m_group << std::endl;
std::cout << "Threads: " << m_threads << std::endl;
+ std::cout << "Statistics Path: " << statistics_path() << std::endl;
+
std::cout << "Plugin Directories:";
for (const auto& dir: m_plugin_directories)
std::cout << " " << dir;