dcavalca / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone
Blob Blame History Raw
From 69e7baa4f6484c39ce25869d0c6252393b7c0411 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Thu, 4 Jun 2020 11:13:48 +0200
Subject: [PATCH] Add log file level main config option (RhBug:1802074)

https://bugzilla.redhat.com/show_bug.cgi?id=1802074
---
 libdnf/conf/ConfigMain.cpp | 3 +++
 libdnf/conf/ConfigMain.hpp | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libdnf/conf/ConfigMain.cpp b/libdnf/conf/ConfigMain.cpp
index 305b8e233..06352b7f3 100644
--- a/libdnf/conf/ConfigMain.cpp
+++ b/libdnf/conf/ConfigMain.cpp
@@ -169,6 +169,7 @@ class ConfigMain::Impl {
 
     OptionNumber<std::int32_t> debuglevel{2, 0, 10};
     OptionNumber<std::int32_t> errorlevel{3, 0, 10};
+    OptionNumber<std::int32_t> logfilelevel{9, 0, 10};
     OptionPath installroot{"/", false, true};
     OptionPath config_file_path{CONF_FILENAME};
     OptionBool plugins{true};
@@ -350,6 +351,7 @@ ConfigMain::Impl::Impl(Config & owner)
 {
     owner.optBinds().add("debuglevel", debuglevel);
     owner.optBinds().add("errorlevel", errorlevel);
+    owner.optBinds().add("logfilelevel", logfilelevel);
     owner.optBinds().add("installroot", installroot);
     owner.optBinds().add("config_file_path", config_file_path);
     owner.optBinds().add("plugins", plugins);
@@ -491,6 +493,7 @@ ConfigMain::~ConfigMain() = default;
 
 OptionNumber<std::int32_t> & ConfigMain::debuglevel() { return pImpl->debuglevel; }
 OptionNumber<std::int32_t> & ConfigMain::errorlevel() { return pImpl->errorlevel; }
+OptionNumber<std::int32_t> & ConfigMain::logfilelevel() { return pImpl->logfilelevel; }
 OptionString & ConfigMain::installroot() { return pImpl->installroot; }
 OptionString & ConfigMain::config_file_path() { return pImpl->config_file_path; }
 OptionBool & ConfigMain::plugins() { return pImpl->plugins; }
diff --git a/libdnf/conf/ConfigMain.hpp b/libdnf/conf/ConfigMain.hpp
index 118ecbf1c..706471029 100644
--- a/libdnf/conf/ConfigMain.hpp
+++ b/libdnf/conf/ConfigMain.hpp
@@ -49,6 +49,7 @@ class ConfigMain : public Config {
 
     OptionNumber<std::int32_t> & debuglevel();
     OptionNumber<std::int32_t> & errorlevel();
+    OptionNumber<std::int32_t> & logfilelevel();
     OptionString & installroot();
     OptionString & config_file_path();
     OptionBool & plugins();