mirror of https://github.com/PCSX2/pcsx2.git
recording: Add logging header to simplify input recording logging
Appends [REC] to console logs when appropriate. Auto appends new-line. Sends similar logs to OSD if desired.
This commit is contained in:
parent
bab8bdfe47
commit
0fede4cb66
|
@ -555,6 +555,7 @@ set(pcsx2RecordingHeaders
|
||||||
${rec_src}/InputRecordingFile.h
|
${rec_src}/InputRecordingFile.h
|
||||||
${rec_src}/NewRecordingFrame.h
|
${rec_src}/NewRecordingFrame.h
|
||||||
${rec_src}/PadData.h
|
${rec_src}/PadData.h
|
||||||
|
${rec_src}/Utilities/InputRecordingLogger.h
|
||||||
${rec_vp_src}/VirtualPad.h
|
${rec_vp_src}/VirtualPad.h
|
||||||
${rec_vp_src}/VirtualPadData.h
|
${rec_vp_src}/VirtualPadData.h
|
||||||
${rec_vp_src}/VirtualPadResources.h
|
${rec_vp_src}/VirtualPadResources.h
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
/* PCSX2 - PS2 Emulator for PCs
|
||||||
|
* Copyright (C) 2002-2020 PCSX2 Dev Team
|
||||||
|
*
|
||||||
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||||
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||||
|
* ation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "App.h"
|
||||||
|
#include "ConsoleLogger.h"
|
||||||
|
#include "DebugTools/Debug.h"
|
||||||
|
#include "Utilities/Console.h"
|
||||||
|
|
||||||
|
#include <fmt/core.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace inputRec
|
||||||
|
{
|
||||||
|
static void log(const std::string& log)
|
||||||
|
{
|
||||||
|
if (log.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
recordingConLog(fmt::format("[REC]: %s\n", log));
|
||||||
|
|
||||||
|
// NOTE - Color is not currently used for OSD logs
|
||||||
|
if (GSosdLog)
|
||||||
|
GSosdLog(log.c_str(), wxGetApp().GetProgramLog()->GetRGBA(ConsoleColors::Color_StrongMagenta));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void consoleLog(const std::string& log)
|
||||||
|
{
|
||||||
|
if (log.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
recordingConLog(fmt::format("[REC]: %s\n", log));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void consoleMultiLog(std::vector<std::string> logs)
|
||||||
|
{
|
||||||
|
std::string log;
|
||||||
|
for (std::string l : logs)
|
||||||
|
log.append(fmt::format("[REC]: %s\n", l));
|
||||||
|
|
||||||
|
recordingConLog(log);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void consoleMultiLog(std::vector<wxString> logs)
|
||||||
|
{
|
||||||
|
std::vector<std::string> stdLogs;
|
||||||
|
for (wxString l : logs)
|
||||||
|
stdLogs.push_back(std::string(l));
|
||||||
|
|
||||||
|
consoleMultiLog(stdLogs);
|
||||||
|
}
|
||||||
|
} // namespace inputRec
|
|
@ -598,6 +598,7 @@
|
||||||
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPad.h" />
|
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPad.h" />
|
||||||
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPadData.h" />
|
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPadData.h" />
|
||||||
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPadResources.h" />
|
<ClInclude Include="..\..\Recording\VirtualPad\VirtualPadResources.h" />
|
||||||
|
<ClInclude Include="..\..\Recording\Utilities\InputRecordingLogger.h" />
|
||||||
<ClInclude Include="..\..\Utilities\AsciiFile.h" />
|
<ClInclude Include="..\..\Utilities\AsciiFile.h" />
|
||||||
<ClInclude Include="..\..\Elfheader.h" />
|
<ClInclude Include="..\..\Elfheader.h" />
|
||||||
<ClInclude Include="..\..\CDVD\IsoFileFormats.h" />
|
<ClInclude Include="..\..\CDVD\IsoFileFormats.h" />
|
||||||
|
|
|
@ -163,6 +163,9 @@
|
||||||
<Filter Include="System\Ps2\SPU2">
|
<Filter Include="System\Ps2\SPU2">
|
||||||
<UniqueIdentifier>{bed493d6-96dc-4057-a1f2-31f88ec927d9}</UniqueIdentifier>
|
<UniqueIdentifier>{bed493d6-96dc-4057-a1f2-31f88ec927d9}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Recording\Utilities">
|
||||||
|
<UniqueIdentifier>{85c5a0d2-6404-439f-8756-d908a1442b96}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
<Filter Include="Recording\VirtualPad\Images">
|
<Filter Include="Recording\VirtualPad\Images">
|
||||||
<UniqueIdentifier>{ad528458-08eb-49a2-aefa-3c2b86ab8896}</UniqueIdentifier>
|
<UniqueIdentifier>{ad528458-08eb-49a2-aefa-3c2b86ab8896}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -1518,6 +1521,9 @@
|
||||||
<ClInclude Include="..\..\SPU2\Windows\WinConfig.h">
|
<ClInclude Include="..\..\SPU2\Windows\WinConfig.h">
|
||||||
<Filter>System\Ps2\SPU2</Filter>
|
<Filter>System\Ps2\SPU2</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\Recording\Utilities\InputRecordingLogger.h">
|
||||||
|
<Filter>Recording\Utilities</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="..\wxResources.rc">
|
<ResourceCompile Include="..\wxResources.rc">
|
||||||
|
|
Loading…
Reference in New Issue