fix standart path location

This commit is contained in:
Andrei Yankovich 2025-02-07 12:11:26 +01:00
parent 6b8bb9f2cd
commit 86c9036f13
2 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,9 @@
#include "params.h"
#include <iostream>
#include <QCoreApplication>
#include <QFile>
#include <QStandardPaths>
namespace QuasarAppUtils {
@ -91,7 +93,7 @@ void QALogger::init() {
if (Params::isEndable("fileLog")) {
_toFile = true;
QString path = Params::getCurrentExecutable() + ".log";
QString path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + QCoreApplication::applicationName() + ".log";
auto file = Params::getArg("fileLog");
if (file.size()) {
path = file;

View File

@ -25,6 +25,8 @@ namespace QuasarAppUtils {
*
* QuasarAppUtils::QALogger logger;
*
* QuasarAppUtils::Params::setEnable("fileLog", true); //force enable file writing using efault file location - located in localApplication data.
*
* QuasarAppUtils::Params::parseParams(argc, argv);
*
* logger.init();