Browse Source
* upgrade `Quamotion.RemoteViewing` to 1.1.211 to work with `RealVNC Viewer` * change AfterSetup to AfterApplicationSetup * remove netstandard2.0 as latest Quamotion.RemoteViewing doest not support it. * downgrade RemoteViewer to 1.1.179 to work with netstandard2.0; remove ILogger parameter use Avalonia.Logging.Logger instead. * adding password method overload to avoid binary break change.pull/14603/head
committed by
GitHub
5 changed files with 134 additions and 23 deletions
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using Avalonia.Logging; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Logging.Abstractions.Internal; |
|||
|
|||
namespace Avalonia.Headless.Vnc; |
|||
|
|||
internal class AvaloniaVncLogger : ILogger |
|||
{ |
|||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) |
|||
{ |
|||
Logger.TryGet(ToLogEventLevel(logLevel), LogArea.VncPlatform) |
|||
?.Log(state, formatter(state,exception)); |
|||
} |
|||
|
|||
public bool IsEnabled(LogLevel logLevel) |
|||
{ |
|||
return Logger.IsEnabled(ToLogEventLevel(logLevel), LogArea.VncPlatform); |
|||
} |
|||
|
|||
public IDisposable BeginScope<TState>(TState state) |
|||
{ |
|||
return NullScope.Instance; |
|||
} |
|||
|
|||
private static LogEventLevel ToLogEventLevel(LogLevel logLevel) |
|||
{ |
|||
return logLevel switch |
|||
{ |
|||
LogLevel.Trace => LogEventLevel.Verbose, |
|||
LogLevel.Debug => LogEventLevel.Debug, |
|||
LogLevel.Information => LogEventLevel.Information, |
|||
LogLevel.Warning => LogEventLevel.Warning, |
|||
LogLevel.Error => LogEventLevel.Error, |
|||
LogLevel.Critical => LogEventLevel.Fatal, |
|||
_ => throw new ArgumentOutOfRangeException(nameof(logLevel)) |
|||
}; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue