mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
1 parent
5c066ce8a7
commit
b7f257152d
3 files changed
+19
-3
No files matched your search
@@ -199,13 +199,14 @@ void LogManager::SetFileLogPath(const Path &filename) {
|
||||
fclose(fp_);
|
||||
}
|
||||
|
||||
if (!filename.empty() && (outputs_ & LogOutput::File)) {
|
||||
logFilename_ = Path(filename);
|
||||
logFilename_ = Path(filename);
|
||||
|
||||
if (outputs_ & LogOutput::File) {
|
||||
File::CreateFullPath(logFilename_.NavigateUp());
|
||||
fp_ = File::OpenCFile(logFilename_, "at");
|
||||
logFileOpenFailed_ = fp_ == nullptr;
|
||||
if (logFileOpenFailed_) {
|
||||
printf("Failed to open log file %s\n", filename.c_str());
|
||||
printf("Failed to open log file %s\n", logFilename_.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +166,20 @@ void DeveloperToolsScreen::CreateGeneralTab(UI::LinearLayout *list) {
|
||||
screenManager()->push(new LogConfigScreen());
|
||||
});
|
||||
list->Add(new CheckBox(&g_Config.bEnableFileLogging, dev->T("Log to file")))->SetEnabledPtr(&g_Config.bEnableLogging);
|
||||
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_DESKTOP) {
|
||||
list->Add(new Choice(dev->T("Show log file in folder")))->OnClick.Add([](UI::EventParams &e) {
|
||||
Path logFilePath = g_logManager.GetLogFilePath();
|
||||
if (logFilePath.empty()) {
|
||||
ERROR_LOG(Log::System, "No log file path configured.");
|
||||
return;
|
||||
}
|
||||
if (File::Exists(logFilePath)) {
|
||||
System_ShowFileInFolder(logFilePath);
|
||||
} else {
|
||||
System_LaunchUrl(LaunchUrlType::LOCAL_FILE, logFilePath.NavigateUp().ToString());
|
||||
}
|
||||
});
|
||||
}
|
||||
list->Add(new CheckBox(&g_Config.bLogFrameDrops, dev->T("Log Dropped Frame Statistics")));
|
||||
if (GetGPUBackend() == GPUBackend::VULKAN) {
|
||||
list->Add(new CheckBox(&g_Config.bGpuLogProfiler, dev->T("GPU log profiler")));
|
||||
|
||||
@@ -650,6 +650,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
}
|
||||
|
||||
if (fileToLog) {
|
||||
// Start logging immediately.
|
||||
g_logManager.EnableOutput(LogOutput::File);
|
||||
g_logManager.SetFileLogPath(Path(fileToLog));
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user