diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index eaeb87d041..862bc11e33 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -30,6 +30,7 @@ #include #include #include +#include /* * Flag to enable advanced config debugging @@ -174,6 +175,8 @@ static const wxChar Skip3DModelMemoryCache[] = wxT( "Skip3DModelMemoryCache" ); static const wxChar HideVersionFromTitle[] = wxT( "HideVersionFromTitle" ); +static const wxChar TraceMasks[] = wxT( "TraceMasks" ); + } // namespace KEYS @@ -392,8 +395,22 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle, &m_HideVersionFromTitle, false ) ); + // Special case for trace mask setting...we just grab them and set them immediately + // Because we even use wxLogTrace inside of advanced config + wxString traceMasks = ""; + configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, "" ) ); + + // Load the config from file wxConfigLoadSetups( &aCfg, configParams ); + // Now actually set the trace masks + wxStringTokenizer traceMaskTokenizer( traceMasks, "," ); + while( traceMaskTokenizer.HasMoreTokens() ) + { + wxString mask = traceMaskTokenizer.GetNextToken(); + wxLog::AddTraceMask( mask ); + } + dumpCfg( configParams ); for( PARAM_CFG* param : configParams )