mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 08:47:10 +02:00
misc: add the ability to ignore UI logs when using trace & debug log levels
This commit is contained in:
parent
7bce8206d5
commit
f3cf03495d
8 changed files with 80 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
using Avalonia.Logging;
|
||||
using Avalonia.Utilities;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Utilities.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
@ -14,13 +15,19 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
internal class LoggerAdapter : ILogSink
|
||||
{
|
||||
private static bool _avaloniaLogsEnabled = ConfigurationState.Instance.Logger.EnableAvaloniaLog;
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
AvaLogger.Sink = new LoggerAdapter();
|
||||
ConfigurationState.Instance.Logger.EnableAvaloniaLog.Event
|
||||
+= (_, e) => _avaloniaLogsEnabled = e.NewValue;
|
||||
}
|
||||
|
||||
private static RyuLogger.Log? GetLog(AvaLogLevel level, string area)
|
||||
{
|
||||
if (!_avaloniaLogsEnabled) return null;
|
||||
|
||||
return level switch
|
||||
{
|
||||
AvaLogLevel.Verbose => RyuLogger.Debug,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue