mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
add option to split log
This commit is contained in:
parent
9424047214
commit
7ed94d8614
@ -69,6 +69,7 @@ static bool vkHostMarkers = false;
|
|||||||
static bool vkGuestMarkers = false;
|
static bool vkGuestMarkers = false;
|
||||||
static bool rdocEnable = false;
|
static bool rdocEnable = false;
|
||||||
static bool isFpsColor = true;
|
static bool isFpsColor = true;
|
||||||
|
static bool isSplitLogEnabled = false;
|
||||||
static s16 cursorState = HideCursorState::Idle;
|
static s16 cursorState = HideCursorState::Idle;
|
||||||
static int cursorHideTimeout = 5; // 5 seconds (default)
|
static int cursorHideTimeout = 5; // 5 seconds (default)
|
||||||
static bool useUnifiedInputConfig = true;
|
static bool useUnifiedInputConfig = true;
|
||||||
@ -451,6 +452,10 @@ void setLogFilter(const std::string& type) {
|
|||||||
logFilter = type;
|
logFilter = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setSplitLogEnabled(bool enabled) {
|
||||||
|
isSplitLogEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
void setUserName(const std::string& type) {
|
void setUserName(const std::string& type) {
|
||||||
userName = type;
|
userName = type;
|
||||||
}
|
}
|
||||||
@ -656,6 +661,10 @@ u32 GetLanguage() {
|
|||||||
return m_language;
|
return m_language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool getSplitLogEnabled() {
|
||||||
|
return isSplitLogEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
int getBackgroundImageOpacity() {
|
int getBackgroundImageOpacity() {
|
||||||
return backgroundImageOpacity;
|
return backgroundImageOpacity;
|
||||||
}
|
}
|
||||||
@ -761,6 +770,7 @@ void load(const std::filesystem::path& path) {
|
|||||||
const toml::value& debug = data.at("Debug");
|
const toml::value& debug = data.at("Debug");
|
||||||
|
|
||||||
isDebugDump = toml::find_or<bool>(debug, "DebugDump", false);
|
isDebugDump = toml::find_or<bool>(debug, "DebugDump", false);
|
||||||
|
isSplitLogEnabled = toml::find_or<bool>(debug, "isSplitLogEnabled", false);
|
||||||
isShaderDebug = toml::find_or<bool>(debug, "CollectShader", false);
|
isShaderDebug = toml::find_or<bool>(debug, "CollectShader", false);
|
||||||
isFpsColor = toml::find_or<bool>(debug, "FPSColor", true);
|
isFpsColor = toml::find_or<bool>(debug, "FPSColor", true);
|
||||||
}
|
}
|
||||||
@ -887,6 +897,7 @@ void save(const std::filesystem::path& path) {
|
|||||||
data["Vulkan"]["rdocEnable"] = rdocEnable;
|
data["Vulkan"]["rdocEnable"] = rdocEnable;
|
||||||
data["Debug"]["DebugDump"] = isDebugDump;
|
data["Debug"]["DebugDump"] = isDebugDump;
|
||||||
data["Debug"]["CollectShader"] = isShaderDebug;
|
data["Debug"]["CollectShader"] = isShaderDebug;
|
||||||
|
data["Debug"]["isSplitLogEnabled"] = isSplitLogEnabled;
|
||||||
data["Debug"]["FPSColor"] = isFpsColor;
|
data["Debug"]["FPSColor"] = isFpsColor;
|
||||||
|
|
||||||
data["Keys"]["TrophyKey"] = trophyKey;
|
data["Keys"]["TrophyKey"] = trophyKey;
|
||||||
|
@ -111,7 +111,8 @@ void setIsMotionControlsEnabled(bool use);
|
|||||||
|
|
||||||
void setLogType(const std::string& type);
|
void setLogType(const std::string& type);
|
||||||
void setLogFilter(const std::string& type);
|
void setLogFilter(const std::string& type);
|
||||||
|
void setSplitLogEnabled(bool enabled);
|
||||||
|
bool getSplitLogEnabled();
|
||||||
void setVkValidation(bool enable);
|
void setVkValidation(bool enable);
|
||||||
void setVkSyncValidation(bool enable);
|
void setVkSyncValidation(bool enable);
|
||||||
void setRdocEnabled(bool enable);
|
void setRdocEnabled(bool enable);
|
||||||
|
@ -139,7 +139,8 @@ public:
|
|||||||
std::filesystem::create_directory(log_dir);
|
std::filesystem::create_directory(log_dir);
|
||||||
Filter filter;
|
Filter filter;
|
||||||
filter.ParseFilterString(Config::getLogFilter());
|
filter.ParseFilterString(Config::getLogFilter());
|
||||||
instance = std::unique_ptr<Impl, decltype(&Deleter)>(new Impl(log_dir / LOG_FILE, filter),
|
const auto& log_file_path = log_file.empty() ? LOG_FILE : log_file;
|
||||||
|
instance = std::unique_ptr<Impl, decltype(&Deleter)>(new Impl(log_dir / log_file_path, filter),
|
||||||
Deleter);
|
Deleter);
|
||||||
initialization_in_progress_suppress_logging = false;
|
initialization_in_progress_suppress_logging = false;
|
||||||
}
|
}
|
||||||
|
@ -50,29 +50,6 @@ Emulator::Emulator() {
|
|||||||
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
|
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Start logger.
|
|
||||||
Common::Log::Initialize();
|
|
||||||
Common::Log::Start();
|
|
||||||
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION);
|
|
||||||
LOG_INFO(Loader, "Revision {}", Common::g_scm_rev);
|
|
||||||
LOG_INFO(Loader, "Branch {}", Common::g_scm_branch);
|
|
||||||
LOG_INFO(Loader, "Description {}", Common::g_scm_desc);
|
|
||||||
LOG_INFO(Loader, "Remote {}", Common::g_scm_remote_url);
|
|
||||||
|
|
||||||
LOG_INFO(Config, "General LogType: {}", Config::getLogType());
|
|
||||||
LOG_INFO(Config, "General isNeo: {}", Config::isNeoModeConsole());
|
|
||||||
LOG_INFO(Config, "GPU isNullGpu: {}", Config::nullGpu());
|
|
||||||
LOG_INFO(Config, "GPU shouldDumpShaders: {}", Config::dumpShaders());
|
|
||||||
LOG_INFO(Config, "GPU vblankDivider: {}", Config::vblankDiv());
|
|
||||||
LOG_INFO(Config, "Vulkan gpuId: {}", Config::getGpuId());
|
|
||||||
LOG_INFO(Config, "Vulkan vkValidation: {}", Config::vkValidationEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan vkValidationSync: {}", Config::vkValidationSyncEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan vkValidationGpu: {}", Config::vkValidationGpuEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan crashDiagnostics: {}", Config::getVkCrashDiagnosticEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan hostMarkers: {}", Config::getVkHostMarkersEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan guestMarkers: {}", Config::getVkGuestMarkersEnabled());
|
|
||||||
LOG_INFO(Config, "Vulkan rdocEnable: {}", Config::isRdocEnabled());
|
|
||||||
|
|
||||||
// Create stdin/stdout/stderr
|
// Create stdin/stdout/stderr
|
||||||
Common::Singleton<FileSys::HandleTable>::Instance()->CreateStdHandles();
|
Common::Singleton<FileSys::HandleTable>::Instance()->CreateStdHandles();
|
||||||
|
|
||||||
@ -90,9 +67,7 @@ Emulator::Emulator() {
|
|||||||
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
QString filePath = QString::fromStdString((user_dir / "play_time.txt").string());
|
QString filePath = QString::fromStdString((user_dir / "play_time.txt").string());
|
||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
ASSERT_MSG(file.open(QIODevice::ReadWrite | QIODevice::Text), "Error opening or creating play_time.txt");
|
||||||
LOG_INFO(Loader, "Error opening or creating play_time.txt");
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +113,34 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
|
|||||||
const auto content_id = param_sfo->GetString("CONTENT_ID");
|
const auto content_id = param_sfo->GetString("CONTENT_ID");
|
||||||
ASSERT_MSG(content_id.has_value(), "Failed to get CONTENT_ID");
|
ASSERT_MSG(content_id.has_value(), "Failed to get CONTENT_ID");
|
||||||
id = std::string(*content_id, 7, 9);
|
id = std::string(*content_id, 7, 9);
|
||||||
|
|
||||||
|
if (Config::getSplitLogEnabled()) {
|
||||||
|
Common::Log::Initialize(id + ".log");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Common::Log::Initialize();
|
||||||
|
}
|
||||||
|
Common::Log::Start();
|
||||||
|
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION);
|
||||||
|
LOG_INFO(Loader, "Revision {}", Common::g_scm_rev);
|
||||||
|
LOG_INFO(Loader, "Branch {}", Common::g_scm_branch);
|
||||||
|
LOG_INFO(Loader, "Description {}", Common::g_scm_desc);
|
||||||
|
LOG_INFO(Loader, "Remote {}", Common::g_scm_remote_url);
|
||||||
|
|
||||||
|
LOG_INFO(Config, "General LogType: {}", Config::getLogType());
|
||||||
|
LOG_INFO(Config, "General isNeo: {}", Config::isNeoModeConsole());
|
||||||
|
LOG_INFO(Config, "GPU isNullGpu: {}", Config::nullGpu());
|
||||||
|
LOG_INFO(Config, "GPU shouldDumpShaders: {}", Config::dumpShaders());
|
||||||
|
LOG_INFO(Config, "GPU vblankDivider: {}", Config::vblankDiv());
|
||||||
|
LOG_INFO(Config, "Vulkan gpuId: {}", Config::getGpuId());
|
||||||
|
LOG_INFO(Config, "Vulkan vkValidation: {}", Config::vkValidationEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan vkValidationSync: {}", Config::vkValidationSyncEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan vkValidationGpu: {}", Config::vkValidationGpuEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan crashDiagnostics: {}", Config::getVkCrashDiagnosticEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan hostMarkers: {}", Config::getVkHostMarkersEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan guestMarkers: {}", Config::getVkGuestMarkersEnabled());
|
||||||
|
LOG_INFO(Config, "Vulkan rdocEnable: {}", Config::isRdocEnabled());
|
||||||
|
|
||||||
Libraries::NpTrophy::game_serial = id;
|
Libraries::NpTrophy::game_serial = id;
|
||||||
const auto trophyDir =
|
const auto trophyDir =
|
||||||
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / id / "TrophyFiles";
|
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / id / "TrophyFiles";
|
||||||
|
@ -404,6 +404,7 @@ void SettingsDialog::LoadValuesFromConfig() {
|
|||||||
QString::fromStdString(toml::find_or<std::string>(data, "Keys", "TrophyKey", "")));
|
QString::fromStdString(toml::find_or<std::string>(data, "Keys", "TrophyKey", "")));
|
||||||
ui->trophyKeyLineEdit->setEchoMode(QLineEdit::Password);
|
ui->trophyKeyLineEdit->setEchoMode(QLineEdit::Password);
|
||||||
ui->debugDump->setChecked(toml::find_or<bool>(data, "Debug", "DebugDump", false));
|
ui->debugDump->setChecked(toml::find_or<bool>(data, "Debug", "DebugDump", false));
|
||||||
|
ui->splitLogCheckbox->setChecked(toml::find_or<bool>(data, "Debug", "isSplitLogEnabled", false));
|
||||||
ui->vkValidationCheckBox->setChecked(toml::find_or<bool>(data, "Vulkan", "validation", false));
|
ui->vkValidationCheckBox->setChecked(toml::find_or<bool>(data, "Vulkan", "validation", false));
|
||||||
ui->vkSyncValidationCheckBox->setChecked(
|
ui->vkSyncValidationCheckBox->setChecked(
|
||||||
toml::find_or<bool>(data, "Vulkan", "validation_sync", false));
|
toml::find_or<bool>(data, "Vulkan", "validation_sync", false));
|
||||||
@ -626,7 +627,8 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
|
|||||||
text = tr("Copy GPU Buffers:\\nGets around race conditions involving GPU submits.\\nMay or may not help with PM4 type 0 crashes.");
|
text = tr("Copy GPU Buffers:\\nGets around race conditions involving GPU submits.\\nMay or may not help with PM4 type 0 crashes.");
|
||||||
} else if (elementName == "collectShaderCheckBox") {
|
} else if (elementName == "collectShaderCheckBox") {
|
||||||
text = tr("Collect Shaders:\\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).");
|
text = tr("Collect Shaders:\\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).");
|
||||||
}
|
} else if (elementName == "splitLogCheckbox") {
|
||||||
|
text = tr("Split Log File:\\nSplits the log file into multiple files, one for each game.");}
|
||||||
// clang-format on
|
// clang-format on
|
||||||
ui->descriptionText->setText(text.replace("\\n", "\n"));
|
ui->descriptionText->setText(text.replace("\\n", "\n"));
|
||||||
}
|
}
|
||||||
@ -678,6 +680,7 @@ void SettingsDialog::UpdateSettings() {
|
|||||||
Config::setLoadGameSizeEnabled(ui->gameSizeCheckBox->isChecked());
|
Config::setLoadGameSizeEnabled(ui->gameSizeCheckBox->isChecked());
|
||||||
Config::setShowSplash(ui->showSplashCheckBox->isChecked());
|
Config::setShowSplash(ui->showSplashCheckBox->isChecked());
|
||||||
Config::setDebugDump(ui->debugDump->isChecked());
|
Config::setDebugDump(ui->debugDump->isChecked());
|
||||||
|
Config::setSplitLogEnabled(ui->splitLogCheckbox->isChecked());
|
||||||
Config::setVkValidation(ui->vkValidationCheckBox->isChecked());
|
Config::setVkValidation(ui->vkValidationCheckBox->isChecked());
|
||||||
Config::setVkSyncValidation(ui->vkSyncValidationCheckBox->isChecked());
|
Config::setVkSyncValidation(ui->vkSyncValidationCheckBox->isChecked());
|
||||||
Config::setRdocEnabled(ui->rdocCheckBox->isChecked());
|
Config::setRdocEnabled(ui->rdocCheckBox->isChecked());
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
||||||
SPDX-License-Identifier: GPL-2.0-or-later -->
|
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>SettingsDialog</class>
|
<class>SettingsDialog</class>
|
||||||
<widget class="QDialog" name="SettingsDialog">
|
<widget class="QDialog" name="SettingsDialog">
|
||||||
@ -59,7 +57,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QScrollArea" name="generalTab">
|
<widget class="QScrollArea" name="generalTab">
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
@ -1877,40 +1875,51 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="advancedLayout">
|
<layout class="QVBoxLayout" name="advancedLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="crashDiagnosticsCheckBox">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<property name="text">
|
<item row="0" column="0">
|
||||||
<string>Enable Crash Diagnostics</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="collectShaderCheckBox">
|
<widget class="QCheckBox" name="collectShaderCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Collect Shaders</string>
|
<string>Collect Shaders</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="copyGPUBuffersCheckBox">
|
<widget class="QCheckBox" name="copyGPUBuffersCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Copy GPU Buffers</string>
|
<string>Copy GPU Buffers</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="crashDiagnosticsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable Crash Diagnostics</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="hostMarkersCheckBox">
|
<widget class="QCheckBox" name="hostMarkersCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Host Debug Markers</string>
|
<string>Host Debug Markers</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="guestMarkersCheckBox">
|
<widget class="QCheckBox" name="guestMarkersCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Guest Debug Markers</string>
|
<string>Guest Debug Markers</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QCheckBox" name="splitLogCheckbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Split Log To Seperate Files For Games</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user