diff options
author | mageven <62494521+mageven@users.noreply.github.com> | 2020-08-04 05:02:53 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 01:32:53 +0200 |
commit | a33dc2f4919f7fdc8ea9db41c4c70c38cedfd3df (patch) | |
tree | d3eee67f25c3a302fa23dc39670438e7ebbfd35c /Ryujinx.HLE/HOS/Services | |
parent | 60db4c353099e8656a330ede03fdbe57a421fa47 (diff) |
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
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
70 files changed, 441 insertions, 442 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs index 96407d1d..9678a4ca 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs @@ -101,7 +101,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc if (!context.Device.System.State.Account.TryGetUser(userId, out UserProfile userProfile)) { - Logger.PrintWarning(LogClass.ServiceAcc, $"User 0x{userId} not found!"); + Logger.Warning?.Print(LogClass.ServiceAcc, $"User 0x{userId} not found!"); return ResultCode.UserNotFound; } @@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // This checks something related to baas (online), and then return an invalid UserId if the check in baas returns an error code. // In our case, we can just log it for now. - Logger.PrintStub(LogClass.ServiceAcc, new { baasCheck }); + Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { baasCheck }); } // As we returned an invalid UserId if there is more than one user earlier, now we can return only the first one. @@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc _applicationLaunchProperty = ApplicationLaunchProperty.GetByPid(context); } - Logger.PrintStub(LogClass.ServiceAcc, new { unknown }); + Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { unknown }); return ResultCode.Success; } @@ -246,7 +246,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // TODO: Store thumbnailBuffer somewhere, in save data 0x8000000000000010 ? - Logger.PrintStub(LogClass.ServiceAcc); + Logger.Stub?.PrintStub(LogClass.ServiceAcc); return ResultCode.Success; } @@ -269,7 +269,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // TODO: Clear the Thumbnail somewhere, in save data 0x8000000000000010 ? - Logger.PrintStub(LogClass.ServiceAcc); + Logger.Stub?.PrintStub(LogClass.ServiceAcc); return ResultCode.Success; } @@ -291,7 +291,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc context.ResponseData.Write(context.Device.Application.ControlData.Value.UserAccountSwitchLock); - Logger.PrintStub(LogClass.ServiceAcc); + Logger.Stub?.PrintStub(LogClass.ServiceAcc); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IManagerForApplication.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IManagerForApplication.cs index 801eae6a..70c5965e 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/IManagerForApplication.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/IManagerForApplication.cs @@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // CheckAvailability() public ResultCode CheckAvailability(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAcc); + Logger.Stub?.PrintStub(LogClass.ServiceAcc); return ResultCode.Success; } @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // GetAccountId() -> nn::account::NetworkServiceAccountId public ResultCode GetAccountId(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); + Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); context.ResponseData.Write(NetworkServiceAccountId); @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // GetNintendoAccountUserResourceCacheForApplication() -> (nn::account::NintendoAccountId, buffer<nn::account::nas::NasUserBaseForApplication, 0x1a>, buffer<bytes, 6>) public ResultCode GetNintendoAccountUserResourceCacheForApplication(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); + Logger.Stub?.PrintStub(LogClass.ServiceAcc, new { NetworkServiceAccountId }); context.ResponseData.Write(NetworkServiceAccountId); diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs index 24a76e50..32ee41d8 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>) public ResultCode Get(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAcc); + Logger.Stub?.PrintStub(LogClass.ServiceAcc); long position = context.Request.ReceiveBuff[0].Position; diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs index 68dadf3d..16ffe9ee 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs @@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib _normalSession.DataAvailable += OnNormalOutData; _interactiveSession.DataAvailable += OnInteractiveOutData; - Logger.PrintInfo(LogClass.ServiceAm, $"Applet '{appletId}' created."); + Logger.Info?.Print(LogClass.ServiceAm, $"Applet '{appletId}' created."); } private void OnAppletStateChanged(object sender, EventArgs e) @@ -194,7 +194,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib context.ResponseData.Write(indirectLayerConsumerHandle); - Logger.PrintStub(LogClass.ServiceAm, new { indirectLayerConsumerHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { indirectLayerConsumerHandle }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs index e630c80d..426914bb 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys float appletVolume = context.RequestData.ReadSingle(); float libraryAppletVolume = context.RequestData.ReadSingle(); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { context.ResponseData.Write(1f); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { context.ResponseData.Write(1f); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys float unknown0 = context.RequestData.ReadSingle(); long unknown1 = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { float unknown0 = context.RequestData.ReadSingle(); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs index 30192455..a2113163 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs @@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { context.ResponseData.Write((byte)0); //Unknown value. - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -120,7 +120,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs index c461c1c4..5fafa154 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs @@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // RequestToGetForeground() public ResultCode RequestToGetForeground(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs index bc0e4d8a..decf5470 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs @@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys if (transferMem == null) { - Logger.PrintWarning(LogClass.ServiceAm, $"Invalid TransferMemory Handle: {handle:X}"); + Logger.Warning?.Print(LogClass.ServiceAm, $"Invalid TransferMemory Handle: {handle:X}"); return ResultCode.Success; // TODO: Find correct error code } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs index f1dab0e5..8b1275ac 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs @@ -41,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // Exit() public ResultCode Exit(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // LockExit() public ResultCode LockExit(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -59,7 +59,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // UnlockExit() public ResultCode UnlockExit(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool screenShotPermission = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { screenShotPermission }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { screenShotPermission }); _screenShotPermission = screenShotPermission; @@ -134,7 +134,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool operationModeChangedNotification = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { operationModeChangedNotification }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { operationModeChangedNotification }); _operationModeChangedNotification = operationModeChangedNotification; @@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool performanceModeChangedNotification = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { performanceModeChangedNotification }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { performanceModeChangedNotification }); _performanceModeChangedNotification = performanceModeChangedNotification; @@ -162,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys bool unknownFlag2 = context.RequestData.ReadBoolean(); bool unknownFlag3 = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { unknownFlag1, unknownFlag2, unknownFlag3 }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { unknownFlag1, unknownFlag2, unknownFlag3 }); return ResultCode.Success; } @@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool restartMessageEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { restartMessageEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { restartMessageEnabled }); _restartMessageEnabled = restartMessageEnabled; @@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool outOfFocusSuspendingEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { outOfFocusSuspendingEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { outOfFocusSuspendingEnabled }); _outOfFocusSuspendingEnabled = outOfFocusSuspendingEnabled; @@ -199,7 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { uint screenShotImageOrientation = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceAm, new { screenShotImageOrientation }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { screenShotImageOrientation }); _screenShotImageOrientation = screenShotImageOrientation; @@ -212,7 +212,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { bool handlesRequestToDisplay = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { handlesRequestToDisplay }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { handlesRequestToDisplay }); _handlesRequestToDisplay = handlesRequestToDisplay; @@ -225,7 +225,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { uint idleTimeDetectionExtension = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceAm, new { idleTimeDetectionExtension }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { idleTimeDetectionExtension }); _idleTimeDetectionExtension = idleTimeDetectionExtension; @@ -238,7 +238,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys { context.ResponseData.Write(_idleTimeDetectionExtension); - Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs index 449658cf..5c5c9b88 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // GetAppletResourceUserId() -> nn::applet::AppletResourceUserId public ResultCode GetAppletResourceUserId(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); context.ResponseData.Write(0L); @@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // AcquireForegroundRights() public ResultCode AcquireForegroundRights(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs index ac24dfc9..5b26b981 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000; - Logger.PrintWarning(LogClass.ServiceAm, + Logger.Warning?.Print(LogClass.ServiceAm, "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); } @@ -93,7 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati if (firstSupported > (int)SystemState.TitleLanguage.Chinese) { - Logger.PrintWarning(LogClass.ServiceAm, "Application has zero supported languages"); + Logger.Warning?.Print(LogClass.ServiceAm, "Application has zero supported languages"); context.ResponseData.Write(desiredLanguageCode); @@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati SystemLanguage newLanguage = Enum.Parse<SystemLanguage>(Enum.GetName(typeof(SystemState.TitleLanguage), firstSupported)); desiredLanguageCode = SystemStateMgr.GetLanguageCode((int)newLanguage); - Logger.PrintInfo(LogClass.ServiceAm, $"Application doesn't support configured language. Using {newLanguage}"); + Logger.Info?.Print(LogClass.ServiceAm, $"Application doesn't support configured language. Using {newLanguage}"); } context.ResponseData.Write(desiredLanguageCode); @@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { Result result = new Result(context.RequestData.ReadUInt32()); - Logger.PrintInfo(LogClass.ServiceAm, $"Result = 0x{result.Value:x8} ({result.ToStringWithName()})."); + Logger.Info?.Print(LogClass.ServiceAm, $"Result = 0x{result.Value:x8} ({result.ToStringWithName()})."); return ResultCode.Success; } @@ -149,7 +149,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // TODO: We return a size of 2GB as we use a directory based save system. This should be enough for most of the games. context.ResponseData.Write(2000000000u); - Logger.PrintStub(LogClass.ServiceAm, new { saveDataType, userId }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { saveDataType, userId }); return ResultCode.Success; } @@ -170,7 +170,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati context.ResponseData.Write(0L); context.ResponseData.Write(0L); - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -179,7 +179,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // InitializeGamePlayRecording(u64, handle<copy>) public ResultCode InitializeGamePlayRecording(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAm); + Logger.Stub?.PrintStub(LogClass.ServiceAm); return ResultCode.Success; } @@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { int state = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceAm, new { state }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { state }); return ResultCode.Success; } @@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { bool applicationCrashReportEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { applicationCrashReportEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { applicationCrashReportEnabled }); return ResultCode.Success; } @@ -246,7 +246,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { // TODO: Initialize buffer and object. - Logger.PrintStub(LogClass.ServiceAm, new { transferMemoryAddress, transferMemorySize, width, height }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { transferMemoryAddress, transferMemorySize, width, height }); resultCode = ResultCode.Success; } @@ -282,7 +282,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati } } - Logger.PrintStub(LogClass.ServiceAm, new { frameBufferPos, frameBufferSize, x, y, width, height, windowOriginMode }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { frameBufferPos, frameBufferSize, x, y, width, height, windowOriginMode }); return resultCode; } @@ -296,7 +296,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati } */ - Logger.PrintStub(LogClass.ServiceAm, new { x, y, width, height, frameBufferPos, frameBufferSize, windowOriginMode }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { x, y, width, height, frameBufferPos, frameBufferSize, windowOriginMode }); return ResultCode.Success; } @@ -307,7 +307,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { bool visible = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceAm, new { visible }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { visible }); // NOTE: It sets an internal field and return ResultCode.Success in all case. @@ -341,7 +341,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati context.ResponseData.Write(previousProgramIndex); - Logger.PrintStub(LogClass.ServiceAm, new { previousProgramIndex }); + Logger.Stub?.PrintStub(LogClass.ServiceAm, new { previousProgramIndex }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Apm/ISession.cs b/Ryujinx.HLE/HOS/Services/Apm/ISession.cs index 10c92e40..a979af76 100644 --- a/Ryujinx.HLE/HOS/Services/Apm/ISession.cs +++ b/Ryujinx.HLE/HOS/Services/Apm/ISession.cs @@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Apm context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1); - Logger.PrintStub(LogClass.ServiceApm); + Logger.Stub?.PrintStub(LogClass.ServiceApm); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioDevice.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioDevice.cs index 56ece87f..1cc263b6 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioDevice.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioDevice.cs @@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager if ((position - basePosition) + buffer.Length > size) { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); break; } @@ -67,7 +67,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager string deviceName = Encoding.ASCII.GetString(deviceNameBuffer); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -89,7 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager } else { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); } return ResultCode.Success; @@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager { context.ResponseData.Write(2); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager if ((position - basePosition) + buffer.Length > size) { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); break; } @@ -167,7 +167,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager string deviceName = Encoding.UTF8.GetString(deviceNameBuffer); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -178,7 +178,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager { context.ResponseData.Write(1f); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -199,7 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager } else { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); } return ResultCode.Success; @@ -216,7 +216,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } @@ -232,7 +232,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs index 16c06b51..b5802d2d 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/IAudioRenderer.cs @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager { context.ResponseData.Write((int)_playState); - Logger.PrintStub(LogClass.ServiceAudio, new { State = Enum.GetName(typeof(PlayState), _playState) }); + Logger.Stub?.PrintStub(LogClass.ServiceAudio, new { State = Enum.GetName(typeof(PlayState), _playState) }); return ResultCode.Success; } @@ -287,7 +287,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager // Start() public ResultCode StartAudioRenderer(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); _playState = PlayState.Playing; @@ -298,7 +298,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager // Stop() public ResultCode StopAudioRenderer(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceAudio); + Logger.Stub?.PrintStub(LogClass.ServiceAudio); _playState = PlayState.Stopped; diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/PerformanceManager.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/PerformanceManager.cs index 1b8c8a7c..a5b3d79f 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/PerformanceManager.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/PerformanceManager.cs @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager if (performanceMetricsDataFormat != 1) { - Logger.PrintWarning(LogClass.ServiceAudio, $"PerformanceMetricsDataFormat: {performanceMetricsDataFormat} is not supported!"); + Logger.Warning?.Print(LogClass.ServiceAudio, $"PerformanceMetricsDataFormat: {performanceMetricsDataFormat} is not supported!"); } return (((parameters.VoiceCount + diff --git a/Ryujinx.HLE/HOS/Services/Audio/IAudioOutManager.cs b/Ryujinx.HLE/HOS/Services/Audio/IAudioOutManager.cs index 508bed40..ae2b9802 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/IAudioOutManager.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/IAudioOutManager.cs @@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio } else { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {size} too small!"); } context.ResponseData.Write(nameCount); @@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio if (deviceName != DefaultAudioOutput) { - Logger.PrintWarning(LogClass.Audio, "Invalid device name!"); + Logger.Warning?.Print(LogClass.Audio, "Invalid device name!"); return ResultCode.DeviceNotFound; } @@ -113,7 +113,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio } else { - Logger.PrintError(LogClass.ServiceAudio, $"Output buffer size {receiveSize} too small!"); + Logger.Error?.Print(LogClass.ServiceAudio, $"Output buffer size {receiveSize} too small!"); } int sampleRate = context.RequestData.ReadInt32(); @@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio if (sampleRate != DefaultSampleRate) { - Logger.PrintWarning(LogClass.Audio, "Invalid sample rate!"); + Logger.Warning?.Print(LogClass.Audio, "Invalid sample rate!"); return ResultCode.UnsupportedSampleRate; } diff --git a/Ryujinx.HLE/HOS/Services/Audio/IAudioRendererManager.cs b/Ryujinx.HLE/HOS/Services/Audio/IAudioRendererManager.cs index 5ca96855..7e770a78 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/IAudioRendererManager.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/IAudioRendererManager.cs @@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio context.ResponseData.Write(size); - Logger.PrintDebug(LogClass.ServiceAudio, $"WorkBufferSize is 0x{size:x16}."); + Logger.Debug?.Print(LogClass.ServiceAudio, $"WorkBufferSize is 0x{size:x16}."); return ResultCode.Success; } @@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio { context.ResponseData.Write(0L); - Logger.PrintWarning(LogClass.ServiceAudio, $"Library Revision REV{AudioRendererCommon.GetRevisionVersion(parameters.Revision)} is not supported!"); + Logger.Warning?.Print(LogClass.ServiceAudio, $"Library Revision REV{AudioRendererCommon.GetRevisionVersion(parameters.Revision)} is not supported!"); return ResultCode.UnsupportedRevision; } @@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio int revisionInfo = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceAudio, new { appletResourceUserId, revisionInfo }); + Logger.Stub?.PrintStub(LogClass.ServiceAudio, new { appletResourceUserId, revisionInfo }); return GetAudioDeviceService(context); } diff --git a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs index 583c0661..d56a6a43 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheProgressService.cs @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceBcat); + Logger.Stub?.PrintStub(LogClass.ServiceBcat); return ResultCode.Success; } @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress); - Logger.PrintStub(LogClass.ServiceBcat); + Logger.Stub?.PrintStub(LogClass.ServiceBcat); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/BluetoothManager/BtmUser/IBtmUserCore.cs b/Ryujinx.HLE/HOS/Services/BluetoothManager/BtmUser/IBtmUserCore.cs index 769e224f..9886b645 100644 --- a/Ryujinx.HLE/HOS/Services/BluetoothManager/BtmUser/IBtmUserCore.cs +++ b/Ryujinx.HLE/HOS/Services/BluetoothManager/BtmUser/IBtmUserCore.cs @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser if (result != KernelResult.Success) { // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. - Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); + Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!"); } } @@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser if (result != KernelResult.Success) { // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. - Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); + Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!"); } } @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser if (result != KernelResult.Success) { // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. - Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); + Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!"); } } @@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser if (result != KernelResult.Success) { // NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not. - Logger.PrintError(LogClass.ServiceBsd, "Out of handles!"); + Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!"); } } diff --git a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs index 4a7d7bb3..fc9b5d59 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs @@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator // There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. context.ResponseData.Write(0); - Logger.PrintStub(LogClass.ServiceFriend, new + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), offset, @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator // There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. context.ResponseData.Write(0); - Logger.PrintStub(LogClass.ServiceFriend, new { + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), offset, filter.PresenceStatus, @@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator // There are no friends blocked, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. context.ResponseData.Write(0); - Logger.PrintStub(LogClass.ServiceFriend, new { offset, UserId = userId.ToString() }); + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { offset, UserId = userId.ToString() }); return ResultCode.Success; } @@ -133,7 +133,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator profile.OnlinePlayState = AccountState.Open; } - Logger.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); return ResultCode.Success; } @@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator profile.OnlinePlayState = AccountState.Closed; } - Logger.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString(), profile.OnlinePlayState }); return ResultCode.Success; } @@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator { UserPresence[] userPresenceInputArray = bufferReader.ReadStructArray<UserPresence>(elementCount); - Logger.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), userPresenceInputArray }); + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), userPresenceInputArray }); } return ResultCode.Success; diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index 68d804ed..a295b94d 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -146,7 +146,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs creationInfo.OwnerId = new TitleId(context.Process.TitleId); } - Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}"); + Logger.Info?.Print(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}"); Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo); @@ -359,7 +359,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs [Command(71)] public ResultCode ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceFs); + Logger.Stub?.PrintStub(LogClass.ServiceFs); MemoryHelper.FillWithZeros(context.Memory, context.Request.ReceiveBuff[0].Position, (int)context.Request.ReceiveBuff[0].Size); @@ -387,7 +387,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // This is because AOC can be distributed over multiple containers in the emulator. if (context.Device.System.ContentManager.GetAocDataStorage((ulong)titleId, out LibHac.Fs.IStorage aocStorage)) { - Logger.PrintInfo(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}"); + Logger.Info?.Print(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}"); MakeObject(context, new FileSystemProxy.IStorage(aocStorage)); @@ -517,7 +517,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs string message = ReadUtf8StringSend(context); // FS ends each line with a newline. Remove it because Ryujinx logging adds its own newline - Logger.PrintAccessLog(LogClass.ServiceFs, message.TrimEnd('\n')); + Logger.AccessLog?.PrintMsg(LogClass.ServiceFs, message.TrimEnd('\n')); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs index ef31e00d..1c882887 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs @@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid if ((config.ConfiguredType & _supportedStyleSets) == 0) { - Logger.PrintWarning(LogClass.Hid, $"ControllerType {config.ConfiguredType} (connected to {(PlayerIndex)i}) not supported by game. Removing..."); + Logger.Warning?.Print(LogClass.Hid, $"ControllerType {config.ConfiguredType} (connected to {(PlayerIndex)i}) not supported by game. Removing..."); config.State = FilterState.Configured; _device.Hid.SharedMemory.Npads[i] = new ShMemNpad(); // Zero it @@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid ControllerType controllerType = npadsTypeList[i]; if ((controllerType & _supportedStyleSets) != 0) { - Logger.PrintWarning(LogClass.Hid, $"No matching controllers found. Reassigning input as ControllerType {controllerType}..."); + Logger.Warning?.Print(LogClass.Hid, $"No matching controllers found. Reassigning input as ControllerType {controllerType}..."); InitController(controllerType == ControllerType.Handheld ? PlayerIndex.Handheld : PlayerIndex.Player1, controllerType); @@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid } } - Logger.PrintError(LogClass.Hid, "Couldn't find any appropriate controller."); + Logger.Error?.Print(LogClass.Hid, "Couldn't find any appropriate controller."); } } @@ -226,7 +226,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _styleSetUpdateEvents[(int)player].ReadableEvent.Signal(); - Logger.PrintInfo(LogClass.Hid, $"Connected ControllerType {type} to PlayerIndex {player}"); + Logger.Info?.Print(LogClass.Hid, $"Connected ControllerType {type} to PlayerIndex {player}"); } private static NpadLayoutsIndex ControllerTypeToLayout(ControllerType controllerType) diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index c6c011b0..3059d947 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Device.Hid.Touchscreen.Active = true; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Device.Hid.Mouse.Active = true; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -108,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Device.Hid.Keyboard.Active = true; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // NOTE: This signal the keyboard driver about lock events. - Logger.PrintStub(LogClass.ServiceHid, new { flags }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { flags }); return ResultCode.Success; } @@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_xpadIdEventHandle); - Logger.PrintStub(LogClass.ServiceHid, new { xpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { xpadId }); return ResultCode.Success; } @@ -152,7 +152,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Process.HandleTable.CloseHandle(_xpadIdEventHandle); - Logger.PrintStub(LogClass.ServiceHid, new { xpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { xpadId }); return ResultCode.Success; } @@ -164,7 +164,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int basicXpadId = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, basicXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, basicXpadId }); return ResultCode.Success; } @@ -176,7 +176,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // There is any Xpad, so we return 0 and write nothing inside the type-0xa buffer. context.ResponseData.Write(0L); - Logger.PrintStub(LogClass.ServiceHid); + Logger.Stub?.PrintStub(LogClass.ServiceHid); return ResultCode.Success; } @@ -187,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int joyXpadId = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId }); return ResultCode.Success; } @@ -202,7 +202,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId }); return ResultCode.Success; } @@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // There is any JoyXpad, so we return 0 and write nothing inside the type-0xa buffer. context.ResponseData.Write(0L); - Logger.PrintStub(LogClass.ServiceHid); + Logger.Stub?.PrintStub(LogClass.ServiceHid); return ResultCode.Success; } @@ -225,7 +225,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int basicXpadId = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId }); return ResultCode.Success; } @@ -236,7 +236,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int basicXpadId = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId }); return ResultCode.Success; } @@ -251,7 +251,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceHid, new { basicXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { basicXpadId }); return ResultCode.Success; } @@ -262,7 +262,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int joyXpadId = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId }); return ResultCode.Success; } @@ -273,7 +273,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int joyXpadId = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId }); return ResultCode.Success; } @@ -288,7 +288,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceHid, new { joyXpadId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { joyXpadId }); return ResultCode.Success; } @@ -300,7 +300,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int sixAxisSensorHandle = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); return ResultCode.Success; } @@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int sixAxisSensorHandle = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle }); return ResultCode.Success; } @@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_sixAxisSensorFusionEnabled); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); return ResultCode.Success; } @@ -339,7 +339,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int sixAxisSensorHandle = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sixAxisSensorFusionEnabled }); return ResultCode.Success; } @@ -358,7 +358,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); return ResultCode.Success; } @@ -373,7 +373,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_sensorFusionParams.RevisePower); context.ResponseData.Write(_sensorFusionParams.ReviseRange); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); return ResultCode.Success; } @@ -388,7 +388,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _sensorFusionParams.RevisePower = 0; _sensorFusionParams.ReviseRange = 0; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _sensorFusionParams.RevisePower, _sensorFusionParams.ReviseRange }); return ResultCode.Success; } @@ -407,7 +407,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); return ResultCode.Success; } @@ -422,7 +422,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_accelerometerParams.X); context.ResponseData.Write(_accelerometerParams.Y); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); return ResultCode.Success; } @@ -437,7 +437,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _accelerometerParams.X = 0; _accelerometerParams.Y = 0; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerParams.X, _accelerometerParams.Y }); return ResultCode.Success; } @@ -450,7 +450,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _accelerometerPlayMode = context.RequestData.ReadUInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); return ResultCode.Success; } @@ -464,7 +464,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_accelerometerPlayMode); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); return ResultCode.Success; } @@ -478,7 +478,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _accelerometerPlayMode = 0; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _accelerometerPlayMode }); return ResultCode.Success; } @@ -491,7 +491,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _gyroscopeZeroDriftMode = (HidGyroscopeZeroDriftMode)context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); return ResultCode.Success; } @@ -505,7 +505,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((int)_gyroscopeZeroDriftMode); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); return ResultCode.Success; } @@ -519,7 +519,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _gyroscopeZeroDriftMode = HidGyroscopeZeroDriftMode.Standard; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, _gyroscopeZeroDriftMode }); return ResultCode.Success; } @@ -535,7 +535,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(isAtRest); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, isAtRest }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, sixAxisSensorHandle, isAtRest }); return ResultCode.Success; } @@ -547,7 +547,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); int unknown0 = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0 }); return ResultCode.Success; } @@ -559,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid ControllerType type = (ControllerType)context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, type }); @@ -577,7 +577,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((int)context.Device.Hid.Npads.SupportedStyleSets); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, context.Device.Hid.Npads.SupportedStyleSets }); @@ -599,7 +599,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid supportedPlayerIds[i] = context.Memory.Read<NpadIdType>((ulong)(context.Request.PtrBuff[0].Position + i * 4)); } - Logger.PrintStub(LogClass.ServiceHid, $"{arraySize} " + string.Join(",", supportedPlayerIds)); + Logger.Stub?.PrintStub(LogClass.ServiceHid, $"{arraySize} " + string.Join(",", supportedPlayerIds)); return ResultCode.Success; } @@ -611,7 +611,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); context.Device.Hid.Npads.Active = true; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -623,7 +623,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); context.Device.Hid.Npads.Active = false; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -644,7 +644,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadId, npadStyleSet }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadId, npadStyleSet }); return ResultCode.Success; } @@ -656,7 +656,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid NpadIdType npadIdType = (NpadIdType)context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadIdType }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, npadIdType }); return ResultCode.Success; } @@ -671,7 +671,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(ledPattern); - Logger.PrintStub(LogClass.ServiceHid, new { npadId, ledPattern }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, ledPattern }); return ResultCode.Success; } @@ -683,7 +683,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int revision = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, revision }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, revision }); return ResultCode.Success; } @@ -695,7 +695,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); context.Device.Hid.Npads.JoyHold = (NpadJoyHoldType)context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, context.Device.Hid.Npads.JoyHold }); @@ -711,7 +711,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((long)context.Device.Hid.Npads.JoyHold); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, context.Device.Hid.Npads.JoyHold }); @@ -728,7 +728,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); return ResultCode.Success; } @@ -743,7 +743,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, hidNpadJoyDeviceType, _npadJoyAssignmentMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, hidNpadJoyDeviceType, _npadJoyAssignmentMode }); return ResultCode.Success; } @@ -757,7 +757,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual; - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, _npadJoyAssignmentMode }); return ResultCode.Success; } @@ -770,7 +770,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long singleJoyId1 = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, singleJoyId0, singleJoyId1 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, singleJoyId0, singleJoyId1 }); return ResultCode.Success; } @@ -781,7 +781,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -792,7 +792,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -804,7 +804,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); _npadHandheldActivationMode = (HidNpadHandheldActivationMode)context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); return ResultCode.Success; } @@ -817,7 +817,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((long)_npadHandheldActivationMode); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadHandheldActivationMode }); return ResultCode.Success; } @@ -830,7 +830,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int newNpadAssignment = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, oldNpadAssignment, newNpadAssignment }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, oldNpadAssignment, newNpadAssignment }); return ResultCode.Success; } @@ -844,7 +844,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_unintendedHomeButtonInputProtectionEnabled); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); return ResultCode.Success; } @@ -857,7 +857,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid uint unknown0 = context.RequestData.ReadUInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknown0, _unintendedHomeButtonInputProtectionEnabled }); return ResultCode.Success; } @@ -875,7 +875,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(0); //Unknown0 context.ResponseData.Write(0); //Unknown1 - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, hidControllerId, hidNpadJoyDeviceType, @@ -902,7 +902,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((int)deviceInfo.DeviceType); context.ResponseData.Write((int)deviceInfo.Position); - Logger.PrintStub(LogClass.ServiceHid, new { vibrationDeviceHandle, deviceInfo.DeviceType, deviceInfo.Position }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { vibrationDeviceHandle, deviceInfo.DeviceType, deviceInfo.Position }); return ResultCode.Success; } @@ -923,7 +923,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Debug?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationValue.AmplitudeLow, @@ -947,7 +947,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_vibrationValue.AmplitudeHigh); context.ResponseData.Write(_vibrationValue.FrequencyHigh); - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationValue.AmplitudeLow, @@ -974,7 +974,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { _vibrationPermitted = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); return ResultCode.Success; } @@ -985,7 +985,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { context.ResponseData.Write(_vibrationPermitted); - Logger.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _vibrationPermitted }); return ResultCode.Success; } @@ -1006,7 +1006,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // TODO: Read all handles and values from buffer. - Logger.PrintStub(LogClass.ServiceHid, new { + Logger.Debug?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, VibrationDeviceHandleBufferLength = vibrationDeviceHandleBuffer.Length, VibrationValueBufferLength = vibrationValueBuffer.Length @@ -1023,7 +1023,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long vibrationGcErmCommand = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, vibrationGcErmCommand }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, vibrationGcErmCommand }); return ResultCode.Success; } @@ -1037,7 +1037,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_vibrationGcErmCommand); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationGcErmCommand }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, vibrationDeviceHandle, _vibrationGcErmCommand }); return ResultCode.Success; } @@ -1048,7 +1048,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1057,7 +1057,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // EndPermitVibrationSession() public ResultCode EndPermitVibrationSession(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceHid); + Logger.Stub?.PrintStub(LogClass.ServiceHid); return ResultCode.Success; } @@ -1068,7 +1068,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1080,7 +1080,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int consoleSixAxisSensorHandle = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); return ResultCode.Success; } @@ -1092,7 +1092,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int consoleSixAxisSensorHandle = context.RequestData.ReadInt32(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, consoleSixAxisSensorHandle }); return ResultCode.Success; } @@ -1103,7 +1103,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1114,7 +1114,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1125,7 +1125,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1140,7 +1140,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid // TODO: Determine if array<nn::sf::NativeHandle> is a buffer or not... - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, counter0, counter1 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, counter0, counter1 }); return ResultCode.Success; } @@ -1151,7 +1151,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId }); return ResultCode.Success; } @@ -1163,7 +1163,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _sevenSixAxisSensorFusionStrength = context.RequestData.ReadSingle(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); return ResultCode.Success; } @@ -1176,7 +1176,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(_sevenSixAxisSensorFusionStrength); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _sevenSixAxisSensorFusionStrength }); return ResultCode.Success; } @@ -1187,7 +1187,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { context.ResponseData.Write(_usbFullKeyControllerEnabled); - Logger.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); return ResultCode.Success; } @@ -1198,7 +1198,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { _usbFullKeyControllerEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _usbFullKeyControllerEnabled }); return ResultCode.Success; } @@ -1211,7 +1211,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(true); //FullKeyController is always connected ? - Logger.PrintStub(LogClass.ServiceHid, new { unknown0, Connected = true }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { unknown0, Connected = true }); return ResultCode.Success; } @@ -1224,7 +1224,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(true); //Npad always got a battery ? - Logger.PrintStub(LogClass.ServiceHid, new { npadId, HasBattery = true }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, HasBattery = true }); return ResultCode.Success; } @@ -1238,7 +1238,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(true); //Npad always got a left battery ? context.ResponseData.Write(true); //Npad always got a right battery ? - Logger.PrintStub(LogClass.ServiceHid, new { npadId, HasLeftBattery = true, HasRightBattery = true }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, HasLeftBattery = true, HasRightBattery = true }); return ResultCode.Success; } @@ -1251,7 +1251,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((byte)0); - Logger.PrintStub(LogClass.ServiceHid, new { npadId, NpadInterfaceType = 0 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, NpadInterfaceType = 0 }); return ResultCode.Success; } @@ -1265,7 +1265,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write((byte)0); context.ResponseData.Write((byte)0); - Logger.PrintStub(LogClass.ServiceHid, new { npadId, LeftInterfaceType = 0, RightInterfaceType = 0 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { npadId, LeftInterfaceType = 0, RightInterfaceType = 0 }); return ResultCode.Success; } @@ -1281,7 +1281,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(palmaConnectionHandle); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId , unknown0, palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId , unknown0, palmaConnectionHandle }); return ResultCode.Success; } @@ -1292,7 +1292,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int palmaConnectionHandle = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1312,7 +1312,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); return ResultCode.Success; } @@ -1327,7 +1327,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid context.ResponseData.Write(unknown0); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); return ResultCode.Success; } @@ -1339,7 +1339,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int palmaConnectionHandle = context.RequestData.ReadInt32(); long unknown0 = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0 }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1353,7 +1353,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int palmaConnectionHandle = context.RequestData.ReadInt32(); long frModeType = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, frModeType }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, frModeType }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1366,7 +1366,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int palmaConnectionHandle = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); return ResultCode.Success; } @@ -1378,7 +1378,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid int palmaConnectionHandle = context.RequestData.ReadInt32(); bool enabledPalmaStep = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, enabledPalmaStep }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, enabledPalmaStep }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1391,7 +1391,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int palmaConnectionHandle = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1406,7 +1406,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long unknown0 = context.RequestData.ReadInt64(); long unknown1 = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); return ResultCode.Success; } @@ -1420,7 +1420,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long unknown1 = context.RequestData.ReadInt64(); // nn::hid::PalmaApplicationSectionAccessBuffer cast is unknown - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle, unknown0, unknown1 }); _palmaOperationCompleteEvent.ReadableEvent.Signal(); @@ -1433,7 +1433,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int palmaConnectionHandle = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); return ResultCode.Success; } @@ -1444,7 +1444,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { int palmaConnectionHandle = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { palmaConnectionHandle }); return ResultCode.Success; } @@ -1456,7 +1456,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid long appletResourceUserId = context.RequestData.ReadInt64(); long unknownBool = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknownBool }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, unknownBool }); return ResultCode.Success; } @@ -1477,7 +1477,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid _npadCommunicationMode = context.RequestData.ReadInt64(); long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadCommunicationMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, _npadCommunicationMode }); return ResultCode.Success; } @@ -1488,7 +1488,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid { context.ResponseData.Write(_npadCommunicationMode); - Logger.PrintStub(LogClass.ServiceHid, new { _npadCommunicationMode }); + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { _npadCommunicationMode }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs index 4851a259..ecf5873e 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); return ResultCode.Success; } @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs { long appletResourceUserId = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); + Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId }); return ResultCode.Success; } @@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs long appletResourceUserId = context.RequestData.ReadInt64(); long packedFunctionLevel = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId, packedFunctionLevel }); + Logger.Stub?.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId, packedFunctionLevel }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs index a2b6d10c..0583e8ba 100644 --- a/Ryujinx.HLE/HOS/Services/IpcService.cs +++ b/Ryujinx.HLE/HOS/Services/IpcService.cs @@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services if (serviceExists) { - Logger.PrintDebug(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}"); + Logger.Debug?.Print(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}"); ProfileConfig profile = Profiles.ServiceCall; @@ -130,7 +130,7 @@ namespace Ryujinx.HLE.HOS.Services serviceName = (dummyService == null) ? service.GetType().FullName : dummyService.ServiceName; - Logger.PrintWarning(LogClass.KernelIpc, $"Missing service {serviceName}: {commandId} ignored"); + Logger.Warning?.Print(LogClass.KernelIpc, $"Missing service {serviceName}: {commandId} ignored"); } if (_isDomain) diff --git a/Ryujinx.HLE/HOS/Services/Ldn/NetworkInterface.cs b/Ryujinx.HLE/HOS/Services/Ldn/NetworkInterface.cs index 10b70ab4..274b6132 100644 --- a/Ryujinx.HLE/HOS/Services/Ldn/NetworkInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ldn/NetworkInterface.cs @@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn // If the call failed, it returns the result code. // If the call succeed, it signal and clear an event then start a new thread named nn.ldn.NetworkInterfaceMonitor. - Logger.PrintStub(LogClass.ServiceLdn, new { version }); + Logger.Stub?.PrintStub(LogClass.ServiceLdn, new { version }); // NOTE: Since we don't support ldn for now, we can return this following result code to make it disabled. return ResultCode.DeviceDisabled; @@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn StateChangeEvent.WritableEvent.Signal(); StateChangeEvent.WritableEvent.Clear(); - Logger.PrintStub(LogClass.ServiceLdn); + Logger.Stub?.PrintStub(LogClass.ServiceLdn); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Lm/LogService/ILogger.cs b/Ryujinx.HLE/HOS/Services/Lm/LogService/ILogger.cs index 05b7238e..732ab856 100644 --- a/Ryujinx.HLE/HOS/Services/Lm/LogService/ILogger.cs +++ b/Ryujinx.HLE/HOS/Services/Lm/LogService/ILogger.cs @@ -8,29 +8,16 @@ namespace Ryujinx.HLE.HOS.Services.Lm.LogService { public ILogger() { } - private static int ReadEncodedInt(BinaryReader reader) + [Command(0)] + // Log(buffer<unknown, 0x21>) + public ResultCode Log(ServiceCtx context) { - int result = 0; - int position = 0; - - byte encoded; - - do - { - encoded = reader.ReadByte(); - - result += (encoded & 0x7F) << (7 * position); - - position++; + Logger.Guest?.Print(LogClass.ServiceLm, LogImpl(context)); - } while ((encoded & 0x80) != 0); - - return result; + return ResultCode.Success; } - [Command(0)] - // Log(buffer<unknown, 0x21>) - public ResultCode Log(ServiceCtx context) + private string LogImpl(ServiceCtx context) { (long bufPos, long bufSize) = context.Request.GetBufferType0x21(); @@ -38,72 +25,85 @@ namespace Ryujinx.HLE.HOS.Services.Lm.LogService context.Memory.Read((ulong)bufPos, logBuffer); - using (MemoryStream ms = new MemoryStream(logBuffer)) - { - BinaryReader reader = new BinaryReader(ms); + using MemoryStream ms = new MemoryStream(logBuffer); - long pid = reader.ReadInt64(); - long threadContext = reader.ReadInt64(); - short flags = reader.ReadInt16(); - byte level = reader.ReadByte(); - byte verbosity = reader.ReadByte(); - int payloadLength = reader.ReadInt32(); + BinaryReader reader = new BinaryReader(ms); - StringBuilder sb = new StringBuilder(); + long pid = reader.ReadInt64(); + long threadContext = reader.ReadInt64(); + short flags = reader.ReadInt16(); + byte level = reader.ReadByte(); + byte verbosity = reader.ReadByte(); + int payloadLength = reader.ReadInt32(); - sb.AppendLine("Guest log:"); + StringBuilder sb = new StringBuilder(); - sb.AppendLine($" Log level: {(LmLogLevel)level}"); + sb.AppendLine($"Guest Log:\n Log level: {(LmLogLevel)level}"); - while (ms.Position < ms.Length) + while (ms.Position < ms.Length) + { + int type = ReadEncodedInt(reader); + int size = ReadEncodedInt(reader); + + LmLogField field = (LmLogField)type; + + string fieldStr = string.Empty; + + if (field == LmLogField.Start) { - int type = ReadEncodedInt(reader); - int size = ReadEncodedInt(reader); - - LmLogField field = (LmLogField)type; - - string fieldStr = string.Empty; - - if (field == LmLogField.Start) - { - reader.ReadBytes(size); - - continue; - } - else if (field == LmLogField.Stop) - { - break; - } - else if (field == LmLogField.Line) - { - fieldStr = $"{field}: {reader.ReadInt32()}"; - } - else if (field == LmLogField.DropCount) - { - fieldStr = $"{field}: {reader.ReadInt64()}"; - } - else if (field == LmLogField.Time) - { - fieldStr = $"{field}: {reader.ReadInt64()}s"; - } - else if (field < LmLogField.Count) - { - fieldStr = $"{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'"; - } - else - { - fieldStr = $"Field{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'"; - } - - sb.AppendLine(" " + fieldStr); - } + reader.ReadBytes(size); - string text = sb.ToString(); + continue; + } + else if (field == LmLogField.Stop) + { + break; + } + else if (field == LmLogField.Line) + { + fieldStr = $"{field}: {reader.ReadInt32()}"; + } + else if (field == LmLogField.DropCount) + { + fieldStr = $"{field}: {reader.ReadInt64()}"; + } + else if (field == LmLogField.Time) + { + fieldStr = $"{field}: {reader.ReadInt64()}s"; + } + else if (field < LmLogField.Count) + { + fieldStr = $"{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'"; + } + else + { + fieldStr = $"Field{field}: '{Encoding.UTF8.GetString(reader.ReadBytes(size)).TrimEnd()}'"; + } - Logger.PrintGuest(LogClass.ServiceLm, text); + sb.AppendLine($" {fieldStr}"); } - return ResultCode.Success; + return sb.ToString(); + } + + private static int ReadEncodedInt(BinaryReader reader) + { + int result = 0; + int position = 0; + + byte encoded; + + do + { + encoded = reader.ReadByte(); + + result += (encoded & 0x7F) << (7 * position); + + position++; + + } while ((encoded & 0x80) != 0); + + return result; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs b/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs index f2891497..49878b7b 100644 --- a/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs +++ b/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm int fgmId = context.RequestData.ReadInt32(); bool isAutoClearEvent = context.RequestData.ReadInt32() != 0; - Logger.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); Register(operationType, fgmId, isAutoClearEvent); @@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm { MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { operationType }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType }); lock (_sessionListLock) { @@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm uint value = context.RequestData.ReadUInt32(); int timeout = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { operationType, value, timeout }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, value, timeout }); lock (_sessionListLock) { @@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm { MultiMediaOperationType operationType = (MultiMediaOperationType)context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { operationType }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType }); lock (_sessionListLock) { @@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm int fgmId = context.RequestData.ReadInt32(); bool isAutoClearEvent = context.RequestData.ReadInt32() != 0; - Logger.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { operationType, fgmId, isAutoClearEvent }); uint id = Register(operationType, fgmId, isAutoClearEvent); @@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm { uint id = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { id }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id }); lock (_sessionListLock) { @@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm uint value = context.RequestData.ReadUInt32(); int timeout = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { id, value, timeout }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id, value, timeout }); lock (_sessionListLock) { @@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Mm { uint id = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceMm, new { id }); + Logger.Stub?.PrintStub(LogClass.ServiceMm, new { id }); lock (_sessionListLock) { diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs index 023a1f3e..d3b5ce3e 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs @@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // Doesn't occur in our case. // return ResultCode.ObjectIsNull; - Logger.PrintStub(LogClass.ServiceNifm, new { version }); + Logger.Stub?.PrintStub(LogClass.ServiceNifm, new { version }); return ResultCode.Success; } @@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService context.ResponseData.WriteStruct(new IpV4Address(unicastAddress.Address)); - Logger.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); + Logger.Info?.Print(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); return ResultCode.Success; } @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService return ResultCode.NoInternetConnection; } - Logger.PrintInfo(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); + Logger.Info?.Print(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); context.ResponseData.WriteStruct(new IpAddressSetting(interfaceProperties, unicastAddress)); context.ResponseData.WriteStruct(new DnsSetting(interfaceProperties)); diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs index 395e976a..2f6be8bf 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs @@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService { context.ResponseData.Write(1); - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); return ResultCode.Success; } @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // GetResult() public ResultCode GetResult(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); return GetResultImpl(); } @@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // Cancel() public ResultCode Cancel(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); return ResultCode.Success; } @@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // Submit() public ResultCode Submit(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); return ResultCode.Success; } @@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // SetConnectionConfirmationOption(i8) public ResultCode SetConnectionConfirmationOption(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); return ResultCode.Success; } @@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService { uint themeColor = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceNifm); + Logger.Stub?.PrintStub(LogClass.ServiceNifm); ResultCode result = GetResultImpl(); diff --git a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs index ad41328e..3d5092d3 100644 --- a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs +++ b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServer.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface { MakeObject(context, new IShopServiceAccessor(context.Device.System)); - Logger.PrintStub(LogClass.ServiceNim); + Logger.Stub?.PrintStub(LogClass.ServiceNim); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs index b3438dd7..e1e8a57e 100644 --- a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs @@ -14,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim { MakeObject(context, new IShopServiceAccessServer()); - Logger.PrintStub(LogClass.ServiceNim); + Logger.Stub?.PrintStub(LogClass.ServiceNim); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs index 6a9bdb06..8cfafb1a 100644 --- a/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs +++ b/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessor.cs @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface.ShopServ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); - Logger.PrintStub(LogClass.ServiceNim); + Logger.Stub?.PrintStub(LogClass.ServiceNim); return ResultCode.Success; } 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; } diff --git a/Ryujinx.HLE/HOS/Services/Ns/IPurchaseEventManager.cs b/Ryujinx.HLE/HOS/Services/Ns/IPurchaseEventManager.cs index 8bb05b04..8d8293c6 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IPurchaseEventManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IPurchaseEventManager.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns // Then it seems to use the buffer content and compare it with a stored linked instrusive list. // Since we don't support purchase from eShop, we can stub it. - Logger.PrintStub(LogClass.ServiceNs); + Logger.Stub?.PrintStub(LogClass.ServiceNs); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs index d6cc85e9..23253cf1 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs @@ -66,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv } else { - Logger.PrintWarning(LogClass.ServiceNv, $"Cannot find file device \"{path}\"!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Cannot find file device \"{path}\"!"); } } @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv { arguments = null; - Logger.PrintWarning(LogClass.ServiceNv, "Ioctl size inconsistency found!"); + Logger.Warning?.Print(LogClass.ServiceNv, "Ioctl size inconsistency found!"); return NvResult.InvalidSize; } @@ -99,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv { arguments = null; - Logger.PrintWarning(LogClass.ServiceNv, "Ioctl size inconsistency found!"); + Logger.Warning?.Print(LogClass.ServiceNv, "Ioctl size inconsistency found!"); return NvResult.InvalidSize; } @@ -145,7 +145,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv if (deviceFile == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid file descriptor {fd}"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid file descriptor {fd}"); return NvResult.NotImplemented; } @@ -162,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv { if (_owner == null) { - Logger.PrintWarning(LogClass.ServiceNv, "INvDrvServices is not initialized!"); + Logger.Warning?.Print(LogClass.ServiceNv, "INvDrvServices is not initialized!"); return NvResult.NotInitialized; } @@ -411,7 +411,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv context.ResponseData.WriteStruct(nvStatus); context.ResponseData.Write((uint)NvResult.Success); - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); } else { @@ -443,7 +443,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv // DumpGraphicsMemoryInfo() public ResultCode DumpGraphicsMemoryInfo(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return ResultCode.Success; } @@ -558,7 +558,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv // FinishInitialize(unknown<8>) public ResultCode FinishInitialize(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs index e426945d..af4734ea 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs @@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices private static NvInternalResult PrintResult(MethodInfo info, NvInternalResult result) { - Logger.PrintDebug(LogClass.ServiceNv, $"{info.Name} returned result {result}"); + Logger.Debug?.Print(LogClass.ServiceNv, $"{info.Name} returned result {result}"); return result; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs index a19e180f..0000f495 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs @@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu private NvInternalResult BindChannel(ref BindChannelArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu { arguments.Offset = 0; - Logger.PrintWarning(LogClass.ServiceNv, $"Failed to allocate size {size:x16}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Failed to allocate size {size:x16}!"); result = NvInternalResult.OutOfMemory; } @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu } else { - Logger.PrintWarning(LogClass.ServiceNv, + Logger.Warning?.Print(LogClass.ServiceNv, $"Failed to free offset 0x{arguments.Offset:x16} size 0x{size:x16}!"); result = NvInternalResult.InvalidInput; @@ -156,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu } else { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid buffer offset {arguments.Offset:x16}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid buffer offset {arguments.Offset:x16}!"); } } @@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments.NvMapHandle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments.NvMapHandle:x8}!"); return NvInternalResult.InvalidInput; } @@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu { string message = string.Format(mapErrorMsg, virtualAddress, arguments.MappingSize, pageSize); - Logger.PrintWarning(LogClass.ServiceNv, message); + Logger.Warning?.Print(LogClass.ServiceNv, message); return NvInternalResult.InvalidInput; } @@ -210,7 +210,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu } else { - Logger.PrintWarning(LogClass.ServiceNv, $"Address 0x{arguments.Offset:x16} not mapped!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Address 0x{arguments.Offset:x16} not mapped!"); return NvInternalResult.InvalidInput; } @@ -244,7 +244,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu { string message = string.Format(mapErrorMsg, arguments.Offset, size, pageSize); - Logger.PrintWarning(LogClass.ServiceNv, message); + Logger.Warning?.Print(LogClass.ServiceNv, message); result = NvInternalResult.InvalidInput; } @@ -258,7 +258,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu { arguments.Offset = 0; - Logger.PrintWarning(LogClass.ServiceNv, $"Failed to map size 0x{size:x16}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Failed to map size 0x{size:x16}!"); result = NvInternalResult.InvalidInput; } @@ -273,14 +273,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu private NvInternalResult GetVaRegions(ref GetVaRegionsArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } private NvInternalResult InitializeEx(ref InitializeExArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -295,7 +295,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments[index].NvMapHandle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid NvMap handle 0x{arguments[index].NvMapHandle:x8}!"); return NvInternalResult.InvalidInput; } @@ -307,7 +307,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu if (result < 0) { - Logger.PrintWarning(LogClass.ServiceNv, + Logger.Warning?.Print(LogClass.ServiceNv, $"Page 0x{arguments[index].GpuOffset:x16} size 0x{arguments[index].Pages:x16} not allocated!"); return NvInternalResult.InvalidInput; diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs index b45d8401..863b01d1 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs @@ -208,7 +208,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel { arguments.Value = 0; - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel { _submitTimeout = submitTimeout; - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -235,7 +235,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); return NvInternalResult.InvalidInput; } @@ -267,7 +267,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{commandBufferEntry.MapHandle:x8}!"); return NvInternalResult.InvalidInput; } @@ -292,7 +292,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel private NvInternalResult SetNvMapFd(ref int nvMapFd) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -301,7 +301,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel { _timeout = timeout; - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -317,21 +317,21 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel private NvInternalResult AllocObjCtx(ref AllocObjCtxArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } private NvInternalResult ZcullBind(ref ZcullBindArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } private NvInternalResult SetErrorNotifier(ref SetErrorNotifierArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -353,7 +353,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel return NvInternalResult.InvalidInput; } - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); // TODO: disable and preempt channel when GPU scheduler will be implemented. @@ -366,7 +366,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel arguments.Fence = _channelSyncpoint; - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -377,7 +377,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel arguments.Fence = _channelSyncpoint; - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -391,7 +391,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel _timeslice = timeslice; // in micro-seconds - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); // TODO: disable and preempt channel when GPU scheduler will be implemented. @@ -400,7 +400,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel private NvInternalResult SetUserData(ref ulong userData) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs index 0035401a..a5384596 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs @@ -185,7 +185,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl { if (stringValue.Length > 0x100) { - Logger.PrintError(LogClass.ServiceNv, $"{arguments.Domain}!{arguments.Parameter} String value size is too big!"); + Logger.Error?.Print(LogClass.ServiceNv, $"{arguments.Domain}!{arguments.Parameter} String value size is too big!"); } else { @@ -205,7 +205,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl throw new NotImplementedException(nvSetting.GetType().Name); } - Logger.PrintDebug(LogClass.ServiceNv, $"Got setting {arguments.Domain}!{arguments.Parameter}"); + Logger.Debug?.Print(LogClass.ServiceNv, $"Got setting {arguments.Domain}!{arguments.Parameter}"); arguments.Configuration = settingBuffer; @@ -451,11 +451,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl } else { - Logger.PrintError(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); + Logger.Error?.Print(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); if (hostEvent != null) { - Logger.PrintError(LogClass.ServiceNv, hostEvent.DumpState(_device.Gpu)); + Logger.Error?.Print(LogClass.ServiceNv, hostEvent.DumpState(_device.Gpu)); } result = NvInternalResult.InvalidInput; @@ -464,7 +464,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl } else { - Logger.PrintError(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); + Logger.Error?.Print(LogClass.ServiceNv, $"Invalid Event at index {eventIndex} (isWaitEventAsyncCmd: {isWaitEventAsyncCmd}, isWaitEventCmd: {isWaitEventCmd})"); result = NvInternalResult.InvalidInput; } @@ -522,7 +522,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl public override void Close() { - Logger.PrintWarning(LogClass.ServiceNv, "Closing channel"); + Logger.Warning?.Print(LogClass.ServiceNv, "Closing channel"); lock (_events) { diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostEvent.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostEvent.cs index a5f3539a..76e1564b 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostEvent.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostEvent.cs @@ -119,7 +119,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl // This allows to keep GPU and CPU in sync when we are slow. if (_failingCount == FailingCountMax) { - Logger.PrintWarning(LogClass.ServiceNv, "GPU processing thread is too slow, waiting on CPU..."); + Logger.Warning?.Print(LogClass.ServiceNv, "GPU processing thread is too slow, waiting on CPU..."); bool timedOut = Fence.Wait(gpuContext, Timeout.InfiniteTimeSpan); diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs index aa730b57..27dd1bd1 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/Types/NvHostSyncPt.cs @@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl } } - Logger.PrintError(LogClass.ServiceNv, "Cannot allocate a new syncpoint!"); + Logger.Error?.Print(LogClass.ServiceNv, "Cannot allocate a new syncpoint!"); return 0; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs index a0b1f43c..e0acf0df 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs @@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu private NvInternalResult ZbcSetTable(ref ZbcSetTableArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); return NvInternalResult.Success; } @@ -213,7 +213,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu private NvInternalResult GetActiveSlotMask(ref GetActiveSlotMaskArguments arguments) { - Logger.PrintStub(LogClass.ServiceNv); + Logger.Stub?.PrintStub(LogClass.ServiceNv); arguments.Slot = 0x07; arguments.Mask = 0x01; diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs index bbc30779..3cc47c42 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs @@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap { if (arguments.Size == 0) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid size 0x{arguments.Size:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid size 0x{arguments.Size:x8}!"); return NvInternalResult.InvalidInput; } @@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap arguments.Handle = CreateHandleFromMap(new NvMapHandle(size)); - Logger.PrintInfo(LogClass.ServiceNv, $"Created map {arguments.Handle} with size 0x{size:x8}!"); + Logger.Info?.Print(LogClass.ServiceNv, $"Created map {arguments.Handle} with size 0x{size:x8}!"); return NvInternalResult.Success; } @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); return NvInternalResult.InvalidInput; } @@ -106,14 +106,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); return NvInternalResult.InvalidInput; } if ((arguments.Align & (arguments.Align - 1)) != 0) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid alignment 0x{arguments.Align:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid alignment 0x{arguments.Align:x8}!"); return NvInternalResult.InvalidInput; } @@ -160,7 +160,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); return NvInternalResult.InvalidInput; } @@ -187,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); return NvInternalResult.InvalidInput; } @@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap if (map == null) { - Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); + Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!"); return NvInternalResult.InvalidInput; } @@ -272,7 +272,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap { DeleteMapWithHandle(process, handle); - Logger.PrintInfo(LogClass.ServiceNv, $"Deleted map {handle}!"); + Logger.Info?.Print(LogClass.ServiceNv, $"Deleted map {handle}!"); return true; } diff --git a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs index 12009a26..af468fca 100644 --- a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs +++ b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs @@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory { // TODO: Service store TitleId and FreeCommunicationEnabled in another static object. // When it's done it signal an event in this static object. - Logger.PrintStub(LogClass.ServicePctl); + Logger.Stub?.PrintStub(LogClass.ServicePctl); } } @@ -70,7 +70,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory // CheckFreeCommunicationPermission() public ResultCode CheckFreeCommunicationPermission(ServiceCtx context) { - Logger.PrintStub(LogClass.ServicePctl); + Logger.Stub?.PrintStub(LogClass.ServicePctl); if (!_freeCommunicationEnabled) { diff --git a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs index 15ef357f..283128fe 100644 --- a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs +++ b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs @@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo context.Memory.Read((ulong)inputPosition, inputBuffer); - Logger.PrintInfo(LogClass.ServicePrepo, ReadReportBuffer(inputBuffer, gameRoom, userId)); + Logger.Info?.Print(LogClass.ServicePrepo, ReadReportBuffer(inputBuffer, gameRoom, userId)); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs b/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs index 9511e79d..ac995b8f 100644 --- a/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs +++ b/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs @@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm context.ResponseData.Write(chargePercentage); - Logger.PrintStub(LogClass.ServicePsm, new { chargePercentage }); + Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargePercentage }); return ResultCode.Success; } @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm context.ResponseData.Write((int)chargerType); - Logger.PrintStub(LogClass.ServicePsm, new { chargerType }); + Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerType }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs b/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs index 4679b154..7caad53c 100644 --- a/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs +++ b/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs @@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_stateChangeEventHandle); - Logger.PrintStub(LogClass.ServicePsm); + Logger.Stub?.PrintStub(LogClass.ServicePsm); return ResultCode.Success; } @@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm _stateChangeEventHandle = -1; } - Logger.PrintStub(LogClass.ServicePsm); + Logger.Stub?.PrintStub(LogClass.ServicePsm); return ResultCode.Success; } @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm { bool chargerTypeChangeEventEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServicePsm, new { chargerTypeChangeEventEnabled }); + Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerTypeChangeEventEnabled }); return ResultCode.Success; } @@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm { bool powerSupplyChangeEventEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServicePsm, new { powerSupplyChangeEventEnabled }); + Logger.Stub?.PrintStub(LogClass.ServicePsm, new { powerSupplyChangeEventEnabled }); return ResultCode.Success; } @@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Psm { bool batteryVoltageStateChangeEventEnabled = context.RequestData.ReadBoolean(); - Logger.PrintStub(LogClass.ServicePsm, new { batteryVoltageStateChangeEventEnabled }); + Logger.Stub?.PrintStub(LogClass.ServicePsm, new { batteryVoltageStateChangeEventEnabled }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs b/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs index 942fab87..c81e49ef 100644 --- a/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs +++ b/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs @@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Ptm.Ts { Location location = (Location)context.RequestData.ReadByte(); - Logger.PrintStub(LogClass.ServicePtm, new { location }); + Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location }); context.ResponseData.Write(DefaultTemperature); diff --git a/Ryujinx.HLE/HOS/Services/Settings/ISettingsServer.cs b/Ryujinx.HLE/HOS/Services/Settings/ISettingsServer.cs index ae877c78..b2be3b31 100644 --- a/Ryujinx.HLE/HOS/Services/Settings/ISettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Settings/ISettingsServer.cs @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings { context.ResponseData.Write(false); - Logger.PrintStub(LogClass.ServiceSet); + Logger.Stub?.PrintStub(LogClass.ServiceSet); return ResultCode.Success; } @@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings { if (context.Request.ReceiveBuff[0].Size != 0x1000) { - Logger.PrintWarning(LogClass.ServiceSet, "Bad size"); + Logger.Warning?.Print(LogClass.ServiceSet, "Bad size"); } byte[] keyCodeMap; diff --git a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs index f3113e65..da7ffa86 100644 --- a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs @@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings { if (stringValue.Length + 1 > replySize) { - Logger.PrintError(LogClass.ServiceSet, $"{askedSetting} String value size is too big!"); + Logger.Error?.Print(LogClass.ServiceSet, $"{askedSetting} String value size is too big!"); } else { @@ -209,11 +209,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings context.Memory.Write((ulong)replyPos, settingBuffer); - Logger.PrintDebug(LogClass.ServiceSet, $"{askedSetting} set value: {nxSetting} as {nxSetting.GetType()}"); + Logger.Debug?.Print(LogClass.ServiceSet, $"{askedSetting} set value: {nxSetting} as {nxSetting.GetType()}"); } else { - Logger.PrintError(LogClass.ServiceSet, $"{askedSetting} not found!"); + Logger.Error?.Print(LogClass.ServiceSet, $"{askedSetting} not found!"); } return ResultCode.Success; diff --git a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs index 54f28af5..37f0a23c 100644 --- a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm { if (ServiceConfiguration.IgnoreMissingServices) { - Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored"); + Logger.Warning?.Print(LogClass.Service, $"Missing service {name} ignored"); session.ClientSession.Service = new DummyService(name); } @@ -136,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm return ResultCode.InvalidName; } - Logger.PrintInfo(LogClass.ServiceSm, $"Register \"{name}\"."); + Logger.Info?.Print(LogClass.ServiceSm, $"Register \"{name}\"."); KPort port = new KPort(context.Device.System.KernelContext, maxSessions, isLight, 0); diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs index d36cb8a9..adeecb66 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs @@ -245,7 +245,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // bsd_error context.ResponseData.Write(0); - Logger.PrintStub(LogClass.ServiceBsd); + Logger.Stub?.PrintStub(LogClass.ServiceBsd); return ResultCode.Success; } @@ -256,7 +256,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { ulong unknown0 = context.RequestData.ReadUInt64(); - Logger.PrintStub(LogClass.ServiceBsd, new { unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceBsd, new { unknown0 }); return ResultCode.Success; } @@ -291,7 +291,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); - Logger.PrintStub(LogClass.ServiceBsd, new { path, flags }); + Logger.Stub?.PrintStub(LogClass.ServiceBsd, new { path, flags }); return ResultCode.Success; } @@ -302,7 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); - Logger.PrintStub(LogClass.ServiceBsd); + Logger.Stub?.PrintStub(LogClass.ServiceBsd); return ResultCode.Success; } @@ -380,7 +380,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (!isValidEvent) { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}"); return WriteBsdResult(context, -1, LinuxError.EINVAL); } } @@ -452,7 +452,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); - Logger.PrintStub(LogClass.ServiceBsd); + Logger.Stub?.PrintStub(LogClass.ServiceBsd); return ResultCode.Success; } @@ -475,7 +475,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0 && (socketFlags & SocketFlags.Peek) == 0) { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); } @@ -516,7 +516,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (socketFlags != SocketFlags.None && (socketFlags & SocketFlags.OutOfBand) == 0 && (socketFlags & SocketFlags.Peek) == 0) { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Recv flags: {socketFlags}"); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); } @@ -559,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand && socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute) { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); } @@ -602,7 +602,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (socketFlags != SocketFlags.None && socketFlags != SocketFlags.OutOfBand && socketFlags != SocketFlags.Peek && socketFlags != SocketFlags.DontRoute) { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Send flags: {socketFlags}"); return WriteBsdResult(context, -1, LinuxError.EOPNOTSUPP); } @@ -811,7 +811,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd } else { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported GetSockOpt Level: {(SocketOptionLevel)level}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported GetSockOpt Level: {(SocketOptionLevel)level}"); } } @@ -872,7 +872,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd default: errno = LinuxError.EOPNOTSUPP; - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {cmd}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {cmd}"); break; } } @@ -946,7 +946,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return LinuxError.SUCCESS; default: - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); return LinuxError.EOPNOTSUPP; } @@ -991,7 +991,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return LinuxError.SUCCESS; default: - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {optionName}"); return LinuxError.EOPNOTSUPP; } @@ -1025,7 +1025,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd } else { - Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt Level: {(SocketOptionLevel)level}"); + Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported SetSockOpt Level: {(SocketOptionLevel)level}"); } } diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs b/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs index c5ceec5b..02a508b0 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Nsd/IManager.cs @@ -221,7 +221,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd // TODO: Call nn::nsd::detail::fs::ReadSaveDataWithOffset() at offset 0 to write the // whole savedata inside the buffer. - Logger.PrintStub(LogClass.ServiceNsd); + Logger.Stub?.PrintStub(LogClass.ServiceNsd); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs index a5e4c11b..2258ada3 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs @@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres long bufferSize = context.Request.SendBuff[0].Size; // TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness. - Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); return ResultCode.NotAllocated; } @@ -159,7 +159,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres uint unknown0 = context.RequestData.ReadUInt32(); // TODO: This is stubbed in 2.0.0+, reverse 1.0.0 version for the sake completeness. - Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); return ResultCode.NotAllocated; } @@ -361,7 +361,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres context.ResponseData.Write(0); - Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); return ResultCode.Success; } @@ -373,7 +373,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres uint unknown0 = context.RequestData.ReadUInt32(); ulong unknown1 = context.RequestData.ReadUInt64(); - Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0, unknown1 }); + Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0, unknown1 }); return ResultCode.Success; } @@ -384,7 +384,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres { uint unknown0 = context.RequestData.ReadUInt32(); - Logger.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); + Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres, new { unknown0 }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs b/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs index 67656f06..7cc15320 100644 --- a/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs +++ b/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs @@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl int sslVersion = context.RequestData.ReadInt32(); long unknown = context.RequestData.ReadInt64(); - Logger.PrintStub(LogClass.ServiceSsl, new { sslVersion, unknown }); + Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { sslVersion, unknown }); MakeObject(context, new ISslContext(context)); @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl { int version = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceSsl, new { version }); + Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { version }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs index b0c8824a..b9ca92b0 100644 --- a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs +++ b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService context.ResponseData.Write(certificateId); - Logger.PrintStub(LogClass.ServiceSsl, new { certificateFormat, certificateDataPosition, certificateDataSize }); + Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { certificateFormat, certificateDataPosition, certificateDataSize }); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueConsumer.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueConsumer.cs index 0465cfcc..c9bb0a65 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueConsumer.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueConsumer.cs @@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { bufferItem = null; - Logger.PrintDebug(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); + Logger.Debug?.Print(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); return Status.InvalidOperation; } @@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (!Core.Slots[slot].RequestBufferCalled) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); return Status.BadValue; } @@ -141,7 +141,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { slot = BufferSlotArray.InvalidBufferSlot; - Logger.PrintError(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Max acquired buffer count reached: {numAcquiredBuffers} (max: {Core.MaxAcquiredBufferCount})"); return Status.InvalidOperation; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs index 0b529a0e..e900cd07 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs @@ -290,7 +290,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { if (Slots[slot].BufferState != BufferState.Acquired) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the consumer (state = {Slots[slot].BufferState})"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the consumer (state = {Slots[slot].BufferState})"); return false; } @@ -302,7 +302,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { if (Slots[slot].BufferState != BufferState.Dequeued) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the producer (state = {Slots[slot].BufferState})"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} is not owned by the producer (state = {Slots[slot].BufferState})"); return false; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueProducer.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueProducer.cs index 3f1eaafe..6ef49538 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueProducer.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueProducer.cs @@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger } else if (preallocatedBufferCount < bufferCount) { - Logger.PrintError(LogClass.SurfaceFlinger, "Not enough buffers. Try with more pre-allocated buffers"); + Logger.Error?.Print(LogClass.SurfaceFlinger, "Not enough buffers. Try with more pre-allocated buffers"); return Status.Success; } @@ -163,7 +163,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { fence = AndroidFence.NoFence; - Logger.PrintError(LogClass.SurfaceFlinger, "No available buffer slots"); + Logger.Error?.Print(LogClass.SurfaceFlinger, "No available buffer slots"); return Status.Busy; } @@ -193,11 +193,10 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger } else { - string formattedError = $"Preallocated buffer mismatch - slot {slot}\n" + - $"available: Width = {graphicBuffer.Width} Height = {graphicBuffer.Height} Format = {graphicBuffer.Format} Usage = {graphicBuffer.Usage:x} " + - $"requested: Width = {width} Height = {height} Format = {format} Usage = {usage:x}"; - - Logger.PrintError(LogClass.SurfaceFlinger, formattedError); + Logger.Error?.Print(LogClass.SurfaceFlinger, + $"Preallocated buffer mismatch - slot {slot}\n" + + $"available: Width = {graphicBuffer.Width} Height = {graphicBuffer.Height} Format = {graphicBuffer.Format} Usage = {graphicBuffer.Usage:x} " + + $"requested: Width = {width} Height = {height} Format = {format} Usage = {usage:x}"); slot = BufferSlotArray.InvalidBufferSlot; fence = AndroidFence.NoFence; @@ -243,7 +242,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (!Core.Slots[slot].RequestBufferCalled) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was detached without requesting a buffer"); return Status.BadValue; } @@ -314,7 +313,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (slot == BufferSlotArray.InvalidBufferSlot) { - Logger.PrintError(LogClass.SurfaceFlinger, "No available buffer slots"); + Logger.Error?.Print(LogClass.SurfaceFlinger, "No available buffer slots"); return Status.Busy; } @@ -373,7 +372,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (!Core.Slots[slot].RequestBufferCalled) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Slot {slot} was queued without requesting a buffer"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Slot {slot} was queued without requesting a buffer"); return Status.BadValue; } @@ -797,7 +796,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (newUndequeuedCount < minUndequeuedCount) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Min undequeued buffer count ({minUndequeuedCount}) exceeded (dequeued = {dequeuedCount} undequeued = {newUndequeuedCount})"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Min undequeued buffer count ({minUndequeuedCount}) exceeded (dequeued = {dequeuedCount} undequeued = {newUndequeuedCount})"); return Status.InvalidOperation; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs index 37bf5b5c..d6c98be1 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs @@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (binder == null) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); return ResultCode.Success; } @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { readableEvent = null; - Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); return; } @@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (binder == null) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IBinder.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IBinder.cs index b25ab28e..9003201b 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IBinder.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IBinder.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (!InterfaceToken.Equals(inputInterfaceToken)) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid interface token {inputInterfaceToken} (expected: {InterfaceToken}"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Invalid interface token {inputInterfaceToken} (expected: {InterfaceToken}"); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IGraphicBufferProducer.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IGraphicBufferProducer.cs index 450d21a2..f0b393a0 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IGraphicBufferProducer.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/IGraphicBufferProducer.cs @@ -269,7 +269,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (status != Status.Success) { - Logger.PrintError(LogClass.SurfaceFlinger, $"Error returned by transaction {(TransactionCode)code}: {status}"); + Logger.Error?.Print(LogClass.SurfaceFlinger, $"Error returned by transaction {(TransactionCode)code}: {status}"); } } diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index dbb05c77..4713e50b 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -125,7 +125,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { lock (Lock) { - Logger.PrintInfo(LogClass.SurfaceFlinger, $"Creating layer {layerId}"); + Logger.Info?.Print(LogClass.SurfaceFlinger, $"Creating layer {layerId}"); BufferQueue.CreateBufferQueue(_device, process, out BufferQueueProducer producer, out BufferQueueConsumer consumer); diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/AndroidFence.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/AndroidFence.cs index a5a9908f..7c5c9ba1 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/AndroidFence.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/AndroidFence.cs @@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger if (hasTimeout) { - Logger.PrintError(LogClass.SurfaceFlinger, "Android fence didn't signal in 3000 ms"); + Logger.Error?.Print(LogClass.SurfaceFlinger, "Android fence didn't signal in 3000 ms"); Wait(gpuContext, Timeout.InfiniteTimeSpan); } diff --git a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForGlue.cs b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForGlue.cs index bbe80fbe..d3b2695b 100644 --- a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForGlue.cs +++ b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForGlue.cs @@ -92,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService if (bufferSize != 0x4000) { // TODO: find error code here - Logger.PrintError(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{bufferSize:x} (expected 0x4000)"); + Logger.Error?.Print(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{bufferSize:x} (expected 0x4000)"); throw new InvalidOperationException(); } diff --git a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs index 4f0e6e9c..c756dfd1 100644 --- a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs +++ b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs @@ -153,7 +153,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService if (timeZoneRuleBufferSize != 0x4000) { // TODO: find error code here - Logger.PrintError(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{timeZoneRuleBufferSize:x} (expected 0x4000)"); + Logger.Error?.Print(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{timeZoneRuleBufferSize:x} (expected 0x4000)"); throw new InvalidOperationException(); } @@ -195,7 +195,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService if (bufferSize != 0x4000) { // TODO: find error code here - Logger.PrintError(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{bufferSize:x} (expected 0x4000)"); + Logger.Error?.Print(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{bufferSize:x} (expected 0x4000)"); throw new InvalidOperationException(); } @@ -240,7 +240,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService if (inBufferSize != 0x4000) { // TODO: find error code here - Logger.PrintError(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{inBufferSize:x} (expected 0x4000)"); + Logger.Error?.Print(LogClass.ServiceTime, $"TimeZoneRule buffer size is 0x{inBufferSize:x} (expected 0x4000)"); throw new InvalidOperationException(); } diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index e2576425..bce4341b 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone return locationName; } - Logger.PrintWarning(LogClass.ServiceTime, $"Invalid device TimeZone {locationName}, switching back to UTC"); + Logger.Warning?.Print(LogClass.ServiceTime, $"Invalid device TimeZone {locationName}, switching back to UTC"); ConfigurationState.Instance.System.TimeZone.Value = "UTC"; @@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone { LocationNameCache = new string[] { "UTC" }; - Logger.PrintError(LogClass.ServiceTime, TimeZoneSystemTitleMissingErrorMessage); + Logger.Error?.Print(LogClass.ServiceTime, TimeZoneSystemTitleMissingErrorMessage); } } @@ -141,7 +141,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone if (romfs.OpenFile(out IFile tzif, $"/zoneinfo/{locName}".ToU8Span(), OpenMode.Read).IsFailure()) { - Logger.PrintError(LogClass.ServiceTime, $"Error opening /zoneinfo/{locName}"); + Logger.Error?.Print(LogClass.ServiceTime, $"Error opening /zoneinfo/{locName}"); continue; } @@ -168,7 +168,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone } else { - Logger.PrintError(LogClass.ServiceTime, $"Couldn't find UTC offset for zone {locName}"); + Logger.Error?.Print(LogClass.ServiceTime, $"Couldn't find UTC offset for zone {locName}"); continue; } diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs index f8ef494a..012a81ff 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs @@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // AddToLayerStack(u32, u64) public ResultCode AddToLayerStack(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceVi); + Logger.Stub?.PrintStub(LogClass.ServiceVi); return ResultCode.Success; } @@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // SetLayerVisibility(b8, u64) public ResultCode SetLayerVisibility(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceVi); + Logger.Stub?.PrintStub(LogClass.ServiceVi); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs index 1e615bd2..194bda2d 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs @@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // SetLayerZ(u64, u64) public ResultCode SetLayerZ(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceVi); + Logger.Stub?.PrintStub(LogClass.ServiceVi); return ResultCode.Success; } @@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // SetLayerVisibility(b8, u64) public ResultCode SetLayerVisibility(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceVi); + Logger.Stub?.PrintStub(LogClass.ServiceVi); return ResultCode.Success; } @@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>) public ResultCode CreateStrayLayer(ServiceCtx context) { - Logger.PrintStub(LogClass.ServiceVi); + Logger.Stub?.PrintStub(LogClass.ServiceVi); return _applicationDisplayService.CreateStrayLayer(context); } |