Skip to content

Commit

Permalink
Return ConfigMain::get_errorlevel_option() API
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Oct 22, 2024
1 parent b2c8300 commit 8d74a48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/libdnf5/conf/config_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ class LIBDNF_API ConfigMain : public Config {

OptionNumber<std::int32_t> & get_debuglevel_option();
const OptionNumber<std::int32_t> & get_debuglevel_option() const;
/// @deprecated errorlevel option does nothing and is scheduled for removal
__attribute((deprecated("errorlevel option does nothing and is scheduled for removal")))
OptionNumber<std::int32_t> &
get_errorlevel_option();
/// @deprecated errorlevel option does nothing and is scheduled for removal
__attribute((deprecated("errorlevel option does nothing and is scheduled for removal")))
const OptionNumber<std::int32_t> &
get_errorlevel_option() const;
OptionPath & get_installroot_option();
const OptionPath & get_installroot_option() const;
OptionPath & get_config_file_path_option();
Expand Down
9 changes: 9 additions & 0 deletions libdnf5/conf/config_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class ConfigMain::Impl {
Config & owner;

OptionNumber<std::int32_t> debuglevel{2, 0, 10};
OptionNumber<std::int32_t> errorlevel{3, 0, 10};
OptionPath installroot{"/", false, true};
OptionBool use_host_config{false};
OptionPath config_file_path{CONF_FILENAME};
Expand Down Expand Up @@ -299,6 +300,7 @@ class ConfigMain::Impl {

ConfigMain::Impl::Impl(Config & owner) : owner(owner) {
owner.opt_binds().add("debuglevel", debuglevel);
owner.opt_binds().add("errorlevel", errorlevel);
owner.opt_binds().add("installroot", installroot);
owner.opt_binds().add("use_host_config", use_host_config);
owner.opt_binds().add("config_file_path", config_file_path);
Expand Down Expand Up @@ -472,6 +474,13 @@ const OptionNumber<std::int32_t> & ConfigMain::get_debuglevel_option() const {
return p_impl->debuglevel;
}

OptionNumber<std::int32_t> & ConfigMain::get_errorlevel_option() {
return p_impl->errorlevel;
}
const OptionNumber<std::int32_t> & ConfigMain::get_errorlevel_option() const {
return p_impl->errorlevel;
}

OptionPath & ConfigMain::get_installroot_option() {
return p_impl->installroot;
}
Expand Down

0 comments on commit 8d74a48

Please sign in to comment.