misc: chore: Improve autoloading DLC/updates logging, deliberately switch to Vulkan if Metal was somehow chosen on a non-mac system, add logger lines in the updater, cleanup enabled logs printing

This commit is contained in:
Evan Husted 2025-01-21 14:59:08 -06:00
parent 182db31343
commit 789d6ab959
6 changed files with 21 additions and 13 deletions

View file

@ -14,6 +14,7 @@ namespace Ryujinx.Common
{ {
switch (currentBackend) switch (currentBackend)
{ {
case GraphicsBackend.Metal when !OperatingSystem.IsMacOS():
case GraphicsBackend.OpenGl when OperatingSystem.IsMacOS(): case GraphicsBackend.OpenGl when OperatingSystem.IsMacOS():
return GraphicsBackend.Vulkan; return GraphicsBackend.Vulkan;
case GraphicsBackend.Vulkan or GraphicsBackend.OpenGl or GraphicsBackend.Metal: case GraphicsBackend.Vulkan or GraphicsBackend.OpenGl or GraphicsBackend.Metal:

View file

@ -674,7 +674,7 @@ namespace Ryujinx.Ava
public async Task<bool> LoadGuestApplication(BlitStruct<ApplicationControlProperty>? customNacpData = null) public async Task<bool> LoadGuestApplication(BlitStruct<ApplicationControlProperty>? customNacpData = null)
{ {
InitializeSwitchInstance(); InitEmulatedSwitch();
MainWindow.UpdateGraphicsConfig(); MainWindow.UpdateGraphicsConfig();
SystemVersion firmwareVersion = ContentManager.GetCurrentFirmwareVersion(); SystemVersion firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
@ -758,6 +758,8 @@ namespace Ryujinx.Ava
romFsFiles = Directory.GetFiles(ApplicationPath, "*.romfs"); romFsFiles = Directory.GetFiles(ApplicationPath, "*.romfs");
} }
Logger.Notice.Print(LogClass.Application, $"Loading unpacked content archive from '{ApplicationPath}'.");
if (romFsFiles.Length > 0) if (romFsFiles.Length > 0)
{ {
Logger.Info?.Print(LogClass.Application, "Loading as cart with RomFS."); Logger.Info?.Print(LogClass.Application, "Loading as cart with RomFS.");
@ -783,6 +785,8 @@ namespace Ryujinx.Ava
} }
else if (File.Exists(ApplicationPath)) else if (File.Exists(ApplicationPath))
{ {
Logger.Notice.Print(LogClass.Application, $"Loading content archive from '{ApplicationPath}'.");
switch (Path.GetExtension(ApplicationPath).ToLowerInvariant()) switch (Path.GetExtension(ApplicationPath).ToLowerInvariant())
{ {
case ".xci": case ".xci":
@ -885,7 +889,7 @@ namespace Ryujinx.Ava
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused"); Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
} }
private void InitializeSwitchInstance() private void InitEmulatedSwitch()
{ {
// Initialize KeySet. // Initialize KeySet.
VirtualFileSystem.ReloadKeySet(); VirtualFileSystem.ReloadKeySet();

View file

@ -233,11 +233,13 @@ namespace Ryujinx.Ava
Logger.Notice.Print(LogClass.Application, $".NET Runtime: {RuntimeInformation.FrameworkDescription}"); Logger.Notice.Print(LogClass.Application, $".NET Runtime: {RuntimeInformation.FrameworkDescription}");
SystemInfo.Gather().Print(); SystemInfo.Gather().Print();
var enabledLogLevels = Logger.GetEnabledLevels().ToArray(); Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {
Logger.GetEnabledLevels()
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0 .FormatCollection(
? "<None>" x => x.ToString(),
: enabledLogLevels.JoinToString(", "))}"); separator: ", ",
emptyCollectionFallback: "<None>")
}");
Logger.Notice.Print(LogClass.Application, Logger.Notice.Print(LogClass.Application,
AppDataManager.Mode == AppDataManager.LaunchMode.Custom AppDataManager.Mode == AppDataManager.LaunchMode.Custom

View file

@ -691,6 +691,7 @@ namespace Ryujinx.Ava.UI.Windows
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs); ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs);
var autoloadDirs = ConfigurationState.Instance.UI.AutoloadDirs.Value; var autoloadDirs = ConfigurationState.Instance.UI.AutoloadDirs.Value;
autoloadDirs.ForEach(dir => Logger.Info?.Print(LogClass.Application, $"Auto loading DLC & updates from: {dir}"));
if (autoloadDirs.Count > 0) if (autoloadDirs.Count > 0)
{ {
var updatesLoaded = ApplicationLibrary.AutoLoadTitleUpdates(autoloadDirs, out int updatesRemoved); var updatesLoaded = ApplicationLibrary.AutoLoadTitleUpdates(autoloadDirs, out int updatesRemoved);

View file

@ -88,6 +88,8 @@ namespace Ryujinx.Ava
return; return;
} }
Logger.Info?.Print(LogClass.Application, "Checking for updates.");
// Get latest version number from GitHub API // Get latest version number from GitHub API
try try
{ {
@ -141,6 +143,8 @@ namespace Ryujinx.Ava
} }
} }
Logger.Info?.Print(LogClass.Application, "Up to date.");
_running = false; _running = false;
return; return;
@ -214,6 +218,8 @@ namespace Ryujinx.Ava
? $"Canary {currentVersion} -> Canary {newVersion}" ? $"Canary {currentVersion} -> Canary {newVersion}"
: $"{currentVersion} -> {newVersion}"; : $"{currentVersion} -> {newVersion}";
Logger.Info?.Print(LogClass.Application, $"Version found: {newVersionString}");
RequestUserToUpdate: RequestUserToUpdate:
// Show a message asking the user if they want to update // Show a message asking the user if they want to update
UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog( UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog(

View file

@ -840,7 +840,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
try try
{ {
// Remove any downloadable content which can no longer be located on disk // Remove any downloadable content which can no longer be located on disk
Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title DLCs");
var dlcToRemove = _downloadableContents.Items var dlcToRemove = _downloadableContents.Items
.Where(dlc => !File.Exists(dlc.Dlc.ContainerPath)) .Where(dlc => !File.Exists(dlc.Dlc.ContainerPath))
.ToList(); .ToList();
@ -852,8 +851,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
foreach (string appDir in appDirs) foreach (string appDir in appDirs)
{ {
Logger.Notice.Print(LogClass.Application, $"Auto loading DLC from: {appDir}");
if (_cancellationToken.Token.IsCancellationRequested) if (_cancellationToken.Token.IsCancellationRequested)
{ {
return newDlcLoaded; return newDlcLoaded;
@ -956,7 +953,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
var titleIdsToRefresh = new HashSet<ulong>(); var titleIdsToRefresh = new HashSet<ulong>();
// Remove any updates which can no longer be located on disk // Remove any updates which can no longer be located on disk
Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title Updates");
var updatesToRemove = _titleUpdates.Items var updatesToRemove = _titleUpdates.Items
.Where(it => !File.Exists(it.TitleUpdate.Path)) .Where(it => !File.Exists(it.TitleUpdate.Path))
.ToList(); .ToList();
@ -971,8 +967,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
foreach (string appDir in appDirs) foreach (string appDir in appDirs)
{ {
Logger.Notice.Print(LogClass.Application, $"Auto loading updates from: {appDir}");
if (_cancellationToken.Token.IsCancellationRequested) if (_cancellationToken.Token.IsCancellationRequested)
{ {
return numUpdatesLoaded; return numUpdatesLoaded;