mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Move logs to data directory
This commit is contained in:
parent
06704728b7
commit
f3c46d3a3b
7 changed files with 17 additions and 43 deletions
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
namespace Utility
|
namespace Utility
|
||||||
{
|
{
|
||||||
QDir stateDirectory();
|
|
||||||
QString toWindowsPath(const QDir &dir);
|
QString toWindowsPath(const QDir &dir);
|
||||||
void printRequest(const QString &type, const QNetworkRequest &request);
|
void printRequest(const QString &type, const QNetworkRequest &request);
|
||||||
void createPathIfNeeded(const QDir &dir);
|
void createPathIfNeeded(const QDir &dir);
|
||||||
|
|
|
@ -63,7 +63,6 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr
|
||||||
|
|
||||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||||
const QDir stateDir = Utility::stateDirectory();
|
|
||||||
const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud"));
|
const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud"));
|
||||||
|
|
||||||
const QDir dalamudConfigDir = configDir.absoluteFilePath(QStringLiteral("dalamud"));
|
const QDir dalamudConfigDir = configDir.absoluteFilePath(QStringLiteral("dalamud"));
|
||||||
|
@ -76,7 +75,7 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr
|
||||||
// so we need to match typical XIVQuickLauncher behavior here. Why? I have no clue.
|
// so we need to match typical XIVQuickLauncher behavior here. Why? I have no clue.
|
||||||
const QDir dalamudPluginDir = dalamudUserPluginDir.absoluteFilePath(QStringLiteral("installedPlugins"));
|
const QDir dalamudPluginDir = dalamudUserPluginDir.absoluteFilePath(QStringLiteral("installedPlugins"));
|
||||||
|
|
||||||
const QString logDir = stateDir.absoluteFilePath(QStringLiteral("log"));
|
const QString logDir = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||||
Utility::createPathIfNeeded(logDir);
|
Utility::createPathIfNeeded(logDir);
|
||||||
|
|
||||||
const QDir dalamudRuntimeDir = dalamudDir.absoluteFilePath(QStringLiteral("runtime"));
|
const QDir dalamudRuntimeDir = dalamudDir.absoluteFilePath(QStringLiteral("runtime"));
|
||||||
|
@ -241,7 +240,8 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
|
||||||
// env.insert(QStringLiteral("VK_LAYER_RENDERDOC_Capture"), QStringLiteral("VK_LAYER_RENDERDOC_Capture"));
|
// env.insert(QStringLiteral("VK_LAYER_RENDERDOC_Capture"), QStringLiteral("VK_LAYER_RENDERDOC_Capture"));
|
||||||
// env.insert(QStringLiteral("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1));
|
// env.insert(QStringLiteral("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1));
|
||||||
|
|
||||||
const QString logDir = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
|
const QString logDir = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||||
|
|
||||||
env.insert(QStringLiteral("DXVK_LOG_PATH"), logDir);
|
env.insert(QStringLiteral("DXVK_LOG_PATH"), logDir);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,8 @@ public:
|
||||||
|
|
||||||
void initialize()
|
void initialize()
|
||||||
{
|
{
|
||||||
const QDir logDirectory = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
|
const QDir logDirectory = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||||
Utility::createPathIfNeeded(logDirectory);
|
Utility::createPathIfNeeded(logDirectory);
|
||||||
|
|
||||||
// Sort them from highest to lowest (4, 3, 2, 1, 0)
|
// Sort them from highest to lowest (4, 3, 2, 1, 0)
|
||||||
|
|
|
@ -23,9 +23,6 @@ using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
initializeLogging();
|
|
||||||
setup_physis_logging();
|
|
||||||
|
|
||||||
QtWebView::initialize();
|
QtWebView::initialize();
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
@ -67,6 +64,9 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
KAboutData::setApplicationData(about);
|
KAboutData::setApplicationData(about);
|
||||||
|
|
||||||
|
initializeLogging();
|
||||||
|
setup_physis_logging();
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
about.setupCommandLine(&parser);
|
about.setupCommandLine(&parser);
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
#include "processlogger.h"
|
#include "processlogger.h"
|
||||||
#include "astra_log.h"
|
#include "astra_log.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
ProcessLogger::ProcessLogger(QProcess *process)
|
ProcessLogger::ProcessLogger(QProcess *process)
|
||||||
{
|
{
|
||||||
const QDir logDirectory = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
|
const QDir logDirectory = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||||
|
|
||||||
m_file.setFileName(logDirectory.absoluteFilePath(QStringLiteral("ffxiv.log")));
|
m_file.setFileName(logDirectory.absoluteFilePath(QStringLiteral("ffxiv.log")));
|
||||||
m_file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
m_file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
||||||
|
|
|
@ -9,18 +9,6 @@
|
||||||
|
|
||||||
using namespace Qt::StringLiterals;
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
QDir Utility::stateDirectory()
|
|
||||||
{
|
|
||||||
if (qEnvironmentVariableIsSet("XDG_STATE_HOME")) {
|
|
||||||
return qEnvironmentVariable("XDG_STATE_HOME");
|
|
||||||
}
|
|
||||||
|
|
||||||
const QDir homeDir = QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0];
|
|
||||||
const QDir localDir = homeDir.absoluteFilePath(QStringLiteral(".local"));
|
|
||||||
const QDir stateDir = localDir.absoluteFilePath(QStringLiteral("state"));
|
|
||||||
return stateDir.absoluteFilePath(QStringLiteral("astra"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Utility::toWindowsPath(const QDir &dir)
|
QString Utility::toWindowsPath(const QDir &dir)
|
||||||
{
|
{
|
||||||
return QStringLiteral("Z:") + dir.absolutePath().replace('/'_L1, '\\'_L1);
|
return QStringLiteral("Z:") + dir.absolutePath().replace('/'_L1, '\\'_L1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app-id: zone.xiv.astra
|
app-id: zone.xiv.astra
|
||||||
runtime: org.kde.Platform
|
runtime: org.kde.Platform
|
||||||
runtime-version: '6.6'
|
cruntime-version: '6.6-kf6preview'
|
||||||
sdk: org.kde.Sdk
|
sdk: org.kde.Sdk
|
||||||
sdk-extensions:
|
sdk-extensions:
|
||||||
- org.freedesktop.Sdk.Extension.rust-stable
|
- org.freedesktop.Sdk.Extension.rust-stable
|
||||||
|
@ -24,7 +24,7 @@ finish-args:
|
||||||
- --device=all
|
- --device=all
|
||||||
- --allow=devel
|
- --allow=devel
|
||||||
modules:
|
modules:
|
||||||
- flatpak/kf6.json
|
#- flatpak/kf6.json
|
||||||
- flatpak/kirigami-addons.json
|
- flatpak/kirigami-addons.json
|
||||||
- name: unshield
|
- name: unshield
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
|
@ -33,7 +33,8 @@ modules:
|
||||||
url: https://github.com/twogood/unshield.git
|
url: https://github.com/twogood/unshield.git
|
||||||
branch: main
|
branch: main
|
||||||
- name: unshield
|
- name: unshield
|
||||||
buildsystem: meson
|
cleanup:
|
||||||
|
- /bin
|
||||||
config-opts:
|
config-opts:
|
||||||
- -Dmanpage=false
|
- -Dmanpage=false
|
||||||
- -Dvapi=false
|
- -Dvapi=false
|
||||||
|
@ -49,6 +50,8 @@ modules:
|
||||||
- name: libsecret
|
- name: libsecret
|
||||||
- stable-only: true
|
- stable-only: true
|
||||||
- name: qtkeychain
|
- name: qtkeychain
|
||||||
|
cleanup:
|
||||||
|
- /bin
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
config-opts:
|
config-opts:
|
||||||
- -DBUILD_WITH_QT6=ON
|
- -DBUILD_WITH_QT6=ON
|
||||||
|
@ -59,11 +62,6 @@ modules:
|
||||||
- type: git
|
- type: git
|
||||||
url: https://github.com/frankosterfeld/qtkeychain.git
|
url: https://github.com/frankosterfeld/qtkeychain.git
|
||||||
branch: main
|
branch: main
|
||||||
- name: quazip
|
|
||||||
buildsystem: cmake-ninja
|
|
||||||
sources:
|
|
||||||
- type: git
|
|
||||||
url: https://github.com/stachenov/quazip.git
|
|
||||||
- name: steamwrap
|
- name: steamwrap
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
|
@ -80,20 +78,6 @@ modules:
|
||||||
- type: file
|
- type: file
|
||||||
url: https://xiv.zone/distrib/steamwrap/libsteam_api.so
|
url: https://xiv.zone/distrib/steamwrap/libsteam_api.so
|
||||||
sha256: b50b9d313eb554792216762f5cc0b972cfae14149f720440e0f0d6c4563c951f
|
sha256: b50b9d313eb554792216762f5cc0b972cfae14149f720440e0f0d6c4563c951f
|
||||||
- name: qcoro
|
|
||||||
buildsystem: cmake-ninja
|
|
||||||
config-optios:
|
|
||||||
- -DQCORO_BUILD_EXAMPLES=OFF
|
|
||||||
- -DBUILD_TESTING=OFF
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://github.com/danvratil/qcoro/archive/refs/tags/v0.7.0.tar.gz
|
|
||||||
sha256: 23ef0217926e67c8d2eb861cf91617da2f7d8d5a9ae6c62321b21448b1669210
|
|
||||||
x-checker-data:
|
|
||||||
- type: anitya
|
|
||||||
project-id: 236236
|
|
||||||
stable-only: true
|
|
||||||
url-template: https://github.com/danvratil/qcoro/archive/refs/tags/v$version.tar.gz
|
|
||||||
- name: qt6-qtwebview
|
- name: qt6-qtwebview
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
cleanup-platform:
|
cleanup-platform:
|
||||||
|
|
Loading…
Add table
Reference in a new issue