Refactor log file location to use application strings
This commit is contained in:
+7
-12
@@ -272,18 +272,13 @@ void setUpLogging()
|
|||||||
conf.set( Level::Trace, ConfigurationType::Enabled, confDisabled );
|
conf.set( Level::Trace, ConfigurationType::Enabled, confDisabled );
|
||||||
conf.set( Level::Debug, ConfigurationType::Enabled, confDisabled );
|
conf.set( Level::Debug, ConfigurationType::Enabled, confDisabled );
|
||||||
|
|
||||||
// This places the log file in
|
const auto appDataLocation
|
||||||
// Roaming/AppData/matzman666/OpenVRAdvancedSettings/AdvancedSettings.log.
|
= std::string( "/" ) + application_strings::applicationOrganizationName
|
||||||
// The log file placement has been broken since at least git tag "v2.7".
|
+ "/" + application_strings::applicationName;
|
||||||
// It was being placed in the working dir of the executable.
|
const auto logFilePath = QDir( QStandardPaths::writableLocation(
|
||||||
// The change hasn't been documented anywhere, so it is likely that it was
|
QStandardPaths::AppDataLocation )
|
||||||
// unintentional. This fixes the probable regression until a new path is
|
+ appDataLocation.c_str() )
|
||||||
// decided on.
|
.absoluteFilePath( "AdvancedSettings.log" );
|
||||||
constexpr auto appDataFolders = "/matzman666/OpenVRAdvancedSettings";
|
|
||||||
const QString logFilePath = QDir( QStandardPaths::writableLocation(
|
|
||||||
QStandardPaths::AppDataLocation )
|
|
||||||
+ appDataFolders )
|
|
||||||
.absoluteFilePath( "AdvancedSettings.log" );
|
|
||||||
conf.set( el::Level::Global,
|
conf.set( el::Level::Global,
|
||||||
el::ConfigurationType::Filename,
|
el::ConfigurationType::Filename,
|
||||||
QDir::toNativeSeparators( logFilePath ).toStdString() );
|
QDir::toNativeSeparators( logFilePath ).toStdString() );
|
||||||
|
|||||||
Reference in New Issue
Block a user