Remove end user changing logging settings

Fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/63

Removes the ability for end users to change logging settings. This was
deemed unnecessary because logging is a developer troubleshooting tool
and users being able to change it could almost only introduce problems.

People who want to change the logging settings can compile from source.
This commit is contained in:
Vasily
2019-03-10 23:12:26 +01:00
committed by username223
parent fd4ab3b0e5
commit ef223b90a1
2 changed files with 6 additions and 25 deletions
+5 -24
View File
@@ -328,9 +328,7 @@ void reinstallApplicationManifest( const QString manifestPath )
}
} // namespace manifest
// Sets up the logging library and outputs startup logging data.
// argc and argv are necessary for the START_EASYLOGGINGPP() call.
void setUpLogging( int argc, char* argv[] )
void setUpLogging()
{
constexpr auto logConfigDefault
= "* GLOBAL:\n"
@@ -345,29 +343,14 @@ void setUpLogging( int argc, char* argv[] )
"* DEBUG:\n"
" ENABLED = false\n";
// This allows easylogging++ to parse command line arguments.
// For a full list go here
// https://github.com/zuhd-org/easyloggingpp#application-arguments
// The parsed args are mostly setting the verbosity level or setting the
// conf file.
START_EASYLOGGINGPP( argc, argv );
const int dummyArgc = 0;
const char** dummyArgv = {};
START_EASYLOGGINGPP( dummyArgc, dummyArgv );
el::Loggers::addFlag( el::LoggingFlag::DisableApplicationAbortOnFatalLog );
// If there is a default logging config file present, use that. If not, use
// the default settings.
constexpr auto logConfigFileName = "logging.conf";
const auto logconfigfile
= QFileInfo( logConfigFileName ).absoluteFilePath();
el::Configurations conf;
if ( QFile::exists( logconfigfile ) )
{
conf.parseFromFile( logconfigfile.toStdString() );
}
else
{
conf.parseFromText( logConfigDefault );
}
conf.parseFromText( logConfigDefault );
// This places the log file in
// Roaming/AppData/matzman666/OpenVRAdvancedSettings/AdvancedSettings.log.
@@ -392,7 +375,5 @@ void setUpLogging( int argc, char* argv[] )
LOG( INFO ) << "Application started (Version "
<< advsettings::OverlayController::applicationVersionString
<< ")";
LOG( INFO ) << "Log Config: "
<< QDir::toNativeSeparators( logconfigfile ).toStdString();
LOG( INFO ) << "Log File: " << logFilePath;
}