fix(config): ensure logging config settings are properly loaded (#3777)
This commit is contained in:
parent
fc9b548edd
commit
3e41770d44
3 changed files with 13 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
12
src/main.cpp
12
src/main.cpp
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue