fix(config): ensure logging config settings are properly loaded (#3777)
This commit is contained in:
@@ -1049,6 +1049,7 @@ namespace config {
|
|||||||
|
|
||||||
for (auto &[name, val] : vars) {
|
for (auto &[name, val] : vars) {
|
||||||
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
|
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
|
||||||
|
modified_config_settings[name] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
int_f(vars, "qp", video.qp);
|
int_f(vars, "qp", video.qp);
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
#include "nvenc/nvenc_config.h"
|
#include "nvenc/nvenc_config.h"
|
||||||
|
|
||||||
namespace config {
|
namespace config {
|
||||||
|
// track modified config options
|
||||||
|
inline std::unordered_map<std::string, std::string> modified_config_settings;
|
||||||
|
|
||||||
struct video_t {
|
struct video_t {
|
||||||
// ffmpeg params
|
// ffmpeg params
|
||||||
int qp; // higher == more compression and less quality
|
int qp; // higher == more compression and less quality
|
||||||
|
|||||||
+9
-3
@@ -106,6 +106,11 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
mail::man = std::make_shared<safe::mail_raw_t>();
|
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);
|
auto log_deinit_guard = logging::init(config::sunshine.min_log_level, config::sunshine.log_file);
|
||||||
if (!log_deinit_guard) {
|
if (!log_deinit_guard) {
|
||||||
BOOST_LOG(error) << "Logging failed to initialize"sv;
|
BOOST_LOG(error) << "Logging failed to initialize"sv;
|
||||||
@@ -119,10 +124,11 @@ int main(int argc, char *argv[]) {
|
|||||||
// Log publisher metadata
|
// Log publisher metadata
|
||||||
log_publisher_data();
|
log_publisher_data();
|
||||||
|
|
||||||
// parse config file
|
// Log modified_config_settings
|
||||||
if (config::parse(argc, argv)) {
|
for (auto &[name, val] : config::modified_config_settings) {
|
||||||
return 0;
|
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
|
||||||
}
|
}
|
||||||
|
config::modified_config_settings.clear();
|
||||||
|
|
||||||
if (!config::sunshine.cmd.name.empty()) {
|
if (!config::sunshine.cmd.name.empty()) {
|
||||||
auto fn = cmd_to_func.find(config::sunshine.cmd.name);
|
auto fn = cmd_to_func.find(config::sunshine.cmd.name);
|
||||||
|
|||||||
Reference in New Issue
Block a user