fix(config): ensure logging config settings are properly loaded (#3777)

This commit is contained in:
ReenigneArcher 2025-04-03 13:32:46 -04:00 committed by GitHub
commit 3e41770d44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View file

@ -1049,6 +1049,7 @@ namespace config {
for (auto &[name, val] : vars) {
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
modified_config_settings[name] = val;
}
int_f(vars, "qp", video.qp);

View file

@ -16,6 +16,9 @@
#include "nvenc/nvenc_config.h"
namespace config {
// track modified config options
inline std::unordered_map<std::string, std::string> modified_config_settings;
struct video_t {
// ffmpeg params
int qp; // higher == more compression and less quality

View file

@ -106,6 +106,11 @@ int main(int argc, char *argv[]) {
mail::man = std::make_shared<safe::mail_raw_t>();
// parse config file
if (config::parse(argc, argv)) {
return 0;
}
auto log_deinit_guard = logging::init(config::sunshine.min_log_level, config::sunshine.log_file);
if (!log_deinit_guard) {
BOOST_LOG(error) << "Logging failed to initialize"sv;
@ -119,10 +124,11 @@ int main(int argc, char *argv[]) {
// Log publisher metadata
log_publisher_data();
// parse config file
if (config::parse(argc, argv)) {
return 0;
// Log modified_config_settings
for (auto &[name, val] : config::modified_config_settings) {
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
}
config::modified_config_settings.clear();
if (!config::sunshine.cmd.name.empty()) {
auto fn = cmd_to_func.find(config::sunshine.cmd.name);