-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
74 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using Microsoft.Extensions.Logging; | ||
using LogLevel = OsuRTDataProvider.LogLevel; | ||
|
||
namespace KeyAsio.Gui.Utils; | ||
|
||
internal class WrapperLogger<T> : OsuRTDataProvider.ILogger<T> | ||
{ | ||
private readonly ILogger _innerLogger; | ||
public WrapperLogger(ILogger innerLogger) => _innerLogger = innerLogger; | ||
public void Log(LogLevel logLevel, string message) => _innerLogger.Log((Microsoft.Extensions.Logging.LogLevel)logLevel, message); | ||
public void LogInformation(string message) => _innerLogger.LogInformation(message); | ||
public void LogDebug(string message) => _innerLogger.LogDebug(message); | ||
public void LogError(string message) => _innerLogger.LogError(message); | ||
public void LogWarning(string message) => _innerLogger.LogWarning(message); | ||
public void LogInformation(Exception exception, string message) => _innerLogger.LogInformation(exception, message); | ||
public void LogDebug(Exception exception, string message) => _innerLogger.LogDebug(exception, message); | ||
public void LogError(Exception exception, string message) => _innerLogger.LogError(exception, message); | ||
public void LogWarning(Exception exception, string message) => _innerLogger.LogWarning(exception, message); | ||
} | ||
|
||
internal class WrapperLogger : WrapperLogger<object> | ||
{ | ||
public WrapperLogger(ILogger innerLogger) : base(innerLogger) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.Extensions.Logging; | ||
using NLog.Extensions.Logging; | ||
|
||
namespace KeyAsio.Gui.Utils; | ||
|
||
internal class WrapperLoggerFactory : OsuRTDataProvider.ILoggerFactory | ||
{ | ||
private readonly ILoggerFactory _loggerFactory; | ||
|
||
public WrapperLoggerFactory(ILoggerFactory loggerFactory) | ||
{ | ||
_loggerFactory = loggerFactory; | ||
} | ||
|
||
public OsuRTDataProvider.ILogger CreateLogger(string name) => new WrapperLogger(_loggerFactory.CreateLogger(name)); | ||
public OsuRTDataProvider.ILogger<T> CreateLogger<T>() => new WrapperLogger<T>(_loggerFactory.CreateLogger<T>()); | ||
|
||
public static WrapperLoggerFactory CreateFromExtensions() => | ||
new(LoggerFactory.Create(k => k.AddNLog().SetMinimumLevel(LogLevel.Trace))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OsuRTDataProviderCore
updated
3 files
+42 −24 | Listen/OSUListenerManager.cs | |
+2 −4 | OsuRTDataProvider.csproj | |
+34 −1 | Utils.cs |