From a33dc2f4919f7fdc8ea9db41c4c70c38cedfd3df Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Tue, 4 Aug 2020 05:02:53 +0530 Subject: Improved Logger (#1292) * Logger class changes only Now compile-time checking is possible with the help of Nullable Value types. * Misc formatting * Manual optimizations PrintGuestLog PrintGuestStackTrace Surfaceflinger DequeueBuffer * Reduce SendVibrationXX log level to Debug * Add Notice log level This level is always enabled and used to print system info, etc... Also, rewrite LogColor to switch expression as colors are static * Unify unhandled exception event handlers * Print enabled LogLevels during init * Re-add App Exit disposes in proper order nit: switch case spacing * Revert PrintGuestStackTrace to Info logs due to #1407 PrintGuestStackTrace is now called in some critical error handlers so revert to old behavior as KThread isn't part of Guest. * Batch replace Logger statements --- Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs') diff --git a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs index e6e42c41..e9f27cb5 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs @@ -28,14 +28,14 @@ namespace Ryujinx.HLE.HOS.Services.Ns byte runtimeAddOnContentInstall = context.Device.Application.ControlData.Value.RuntimeAddOnContentInstall; if (runtimeAddOnContentInstall != 0) { - Logger.PrintWarning(LogClass.ServiceNs, $"RuntimeAddOnContentInstall is true. Some DLC may be missing"); + Logger.Warning?.Print(LogClass.ServiceNs, $"RuntimeAddOnContentInstall is true. Some DLC may be missing"); } uint aocCount = CountAddOnContentImpl(context); context.ResponseData.Write(aocCount); - Logger.PrintStub(LogClass.ServiceNs, new { aocCount, runtimeAddOnContentInstall }); + Logger.Stub?.PrintStub(LogClass.ServiceNs, new { aocCount, runtimeAddOnContentInstall }); return ResultCode.Success; } @@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns context.Memory.Write(bufAddr + (ulong)i * 4, (int)(aocTitleIds[i + (int)startIndex] - aocBaseId)); } - Logger.PrintStub(LogClass.ServiceNs, new { bufferSize, startIndex, aocCount }); + Logger.Stub?.PrintStub(LogClass.ServiceNs, new { bufferSize, startIndex, aocCount }); return ResultCode.Success; } @@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns context.ResponseData.Write(aocBaseId); - Logger.PrintStub(LogClass.ServiceNs, $"aocBaseId={aocBaseId:X16}"); + Logger.Stub?.PrintStub(LogClass.ServiceNs, $"aocBaseId={aocBaseId:X16}"); // ResultCode will be error code of GetApplicationLaunchProperty if it fails return ResultCode.Success; @@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns // Ideally, this should probably initialize the AocData values for the specified index - Logger.PrintStub(LogClass.ServiceNs, new { aocIndex }); + Logger.Stub?.PrintStub(LogClass.ServiceNs, new { aocIndex }); return ResultCode.Success; } @@ -142,7 +142,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceNs); + Logger.Stub?.PrintStub(LogClass.ServiceNs); return ResultCode.Success; } @@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns // which gives 0x874 (2000+164). 164 being Module ID of `EC (Shop)` context.ResponseData.Write(2164L); - Logger.PrintStub(LogClass.ServiceNs); + Logger.Stub?.PrintStub(LogClass.ServiceNs); return ResultCode.Success; } @@ -167,7 +167,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns { MakeObject(context, new IPurchaseEventManager(context.Device.System)); - Logger.PrintStub(LogClass.ServiceNs); + Logger.Stub?.PrintStub(LogClass.ServiceNs); return ResultCode.Success; } @@ -180,7 +180,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns MakeObject(context, new IPurchaseEventManager(context.Device.System)); - Logger.PrintStub(LogClass.ServiceNs); + Logger.Stub?.PrintStub(LogClass.ServiceNs); return ResultCode.Success; } -- cgit v1.2.3