Skip to content

Commit

Permalink
UI: Redirect IME errors to Debug instead of error
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Dec 27, 2024
1 parent d7b3dd1 commit 267e9f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Ryujinx/UI/Helpers/LoggerAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@ public static void Register()
AvaLogger.Sink = new LoggerAdapter();
}

private static RyuLogger.Log? GetLog(AvaLogLevel level)
private static RyuLogger.Log? GetLog(AvaLogLevel level, string area)
{
return level switch
{
AvaLogLevel.Verbose => RyuLogger.Debug,
AvaLogLevel.Debug => RyuLogger.Debug,
AvaLogLevel.Information => RyuLogger.Debug,
AvaLogLevel.Warning => RyuLogger.Debug,
AvaLogLevel.Error => RyuLogger.Error,
AvaLogLevel.Error => area is "IME" ? RyuLogger.Debug : RyuLogger.Error,
AvaLogLevel.Fatal => RyuLogger.Error,
_ => throw new ArgumentOutOfRangeException(nameof(level), level, null),
};
}

public bool IsEnabled(AvaLogLevel level, string area)
{
return GetLog(level) != null;
return GetLog(level, area) != null;
}

public void Log(AvaLogLevel level, string area, object source, string messageTemplate)
{
GetLog(level)?.PrintMsg(RyuLogClass.UI, Format(level, area, messageTemplate, source, null));
GetLog(level, area)?.PrintMsg(RyuLogClass.UI, Format(level, area, messageTemplate, source, null));
}

public void Log(AvaLogLevel level, string area, object source, string messageTemplate, params object[] propertyValues)
{
GetLog(level)?.PrintMsg(RyuLogClass.UI, Format(level, area, messageTemplate, source, propertyValues));
GetLog(level, area)?.PrintMsg(RyuLogClass.UI, Format(level, area, messageTemplate, source, propertyValues));
}

private static string Format(AvaLogLevel level, string area, string template, object source, object[] v)
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:local="clr-namespace:Ryujinx.Ava.UI.Views.Main"
xmlns:config="clr-namespace:Ryujinx.Common.Configuration;assembly=Ryujinx.Common"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.Ava.UI.Views.Main.MainStatusBarView"
Expand Down

0 comments on commit 267e9f6

Please sign in to comment.