Refactor Ryujinx.Common and HLE Stub Logging (#537)

* Refactor Ryujinx.Common and HLE Stub Logging

* Resolve review comments

* Rename missed loop variable

* Optimize PrintStub logging function

* Pass the call-sites Thread ID through to the logger

* Remove superfluous lock from ConsoleLog

* Process logged data objects in the logger target

Pass the data object all the way to the output logger targets, to allow them to "serialize" this in whatever appropriate format they're logging in.

* Use existing StringBuilder to build the properties string

* Add a ServiceNotImplemented Exception

Useful for printing debug information about unimplemented service calls

* Resolve Style Nits

* Resolve Merge Issues

* Fix typo and align declarations
This commit is contained in:
jduncanator 2019-01-11 11:11:46 +11:00 committed by Ac_K
parent 600799ba87
commit 8406ec6272
42 changed files with 696 additions and 478 deletions

View file

@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
long uIdLow = context.RequestData.ReadInt64();
long uIdHigh = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
context.ResponseData.Write(0L);
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long GetPseudoDeviceId(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
context.ResponseData.Write(0L);
context.ResponseData.Write(0L);
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long InitializeGamePlayRecording(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
int state = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}

View file

@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
float appletVolume = context.RequestData.ReadSingle();
float libraryAppletVolume = context.RequestData.ReadSingle();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
context.ResponseData.Write(1f);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
context.ResponseData.Write(1f);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
float unknown0 = context.RequestData.ReadSingle();
long unknown1 = context.RequestData.ReadInt64();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
float unknown0 = context.RequestData.ReadSingle();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}

View file

@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
context.ResponseData.Write((byte)0); //Unknown value.
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -115,7 +115,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}

View file

@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long RequestToGetForeground(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}

View file

@ -40,28 +40,28 @@ namespace Ryujinx.HLE.HOS.Services.Am
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
public long Start(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
public long GetResult(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
public long PushInData(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}

View file

@ -42,21 +42,21 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long Exit(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
public long LockExit(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
public long UnlockExit(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -81,7 +81,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -99,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
bool flag2 = context.RequestData.ReadByte() != 0;
bool flag3 = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -119,7 +119,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
int orientation = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -146,7 +146,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
bool enable = context.RequestData.ReadByte() != 0;
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}
@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
_idleTimeDetectionExtension = context.RequestData.ReadInt32();
Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {_idleTimeDetectionExtension}");
Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension });
return 0;
}
@ -166,7 +166,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
{
context.ResponseData.Write(_idleTimeDetectionExtension);
Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {_idleTimeDetectionExtension}");
Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension });
return 0;
}

View file

@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long GetAppletResourceUserId(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
context.ResponseData.Write(0L);
@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Am
public long AcquireForegroundRights(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceAm, "Stubbed.");
Logger.PrintStub(LogClass.ServiceAm);
return 0;
}