From b951b0973cfd4e0db4607a00d434a04afb0d6199 Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Mon, 20 Jan 2020 08:32:42 -0700 Subject: on startup, write config options to debug.log --- src/util/system.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/util/system.cpp') diff --git a/src/util/system.cpp b/src/util/system.cpp index 588ddc1fc..ff3967c57 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -864,6 +864,32 @@ std::vector ArgsManager::GetSettingsList(const std::string& return util::GetSettingsList(m_settings, m_network, SettingName(arg), !UseDefaultSection(arg)); } +void ArgsManager::logArgsPrefix( + const std::string& prefix, + const std::string& section, + const std::map>& args) const +{ + std::string section_str = section.empty() ? "" : "[" + section + "] "; + for (const auto& arg : args) { + for (const auto& value : arg.second) { + Optional flags = GetArgFlags('-' + arg.first); + if (flags) { + std::string value_str = (*flags & SENSITIVE) ? "****" : value.write(); + LogPrintf("%s %s%s=%s\n", prefix, section_str, arg.first, value_str); + } + } + } +} + +void ArgsManager::LogArgs() const +{ + LOCK(cs_args); + for (const auto& section : m_settings.ro_config) { + logArgsPrefix("Config file arg:", section.first, section.second); + } + logArgsPrefix("Command-line arg:", "", m_settings.command_line_options); +} + bool RenameOver(fs::path src, fs::path dest) { #ifdef WIN32 -- cgit v1.2.3