Implement Microsoft.Extensions.Logger Wrapper#263
Open
bagusnl wants to merge 1 commit intoLachee:masterfrom
Open
Implement Microsoft.Extensions.Logger Wrapper#263bagusnl wants to merge 1 commit intoLachee:masterfrom
bagusnl wants to merge 1 commit intoLachee:masterfrom
Conversation
Only works for netstandard2.0 at the moment
Lachee
requested changes
Jul 28, 2025
Owner
Lachee
left a comment
There was a problem hiding this comment.
Need some changes. Overall a good idea to implement that standard interface.
| using DiscordRPC.RPC.Commands; | ||
| using System; | ||
| #if !DISABLE_MSLOGGEREXTENSION | ||
| using Hi3Helper.SharpDiscordRPC.DiscordRPC.Logging; |
Owner
There was a problem hiding this comment.
required change: Use the same namespace from the project
| using System; | ||
| #if !DISABLE_MSLOGGEREXTENSION | ||
| using Hi3Helper.SharpDiscordRPC.DiscordRPC.Logging; | ||
| using ILoggerMs = Microsoft.Extensions.Logging.ILogger; |
Owner
There was a problem hiding this comment.
required change: Use fully qualified naming instead of aliases for ambiguities.
| /// <summary> | ||
| /// Wraps a <see cref="ILogger"/> to a <see cref="ILoggerRpc"/> | ||
| /// </summary> | ||
| public class MsILoggerWrapper : ILoggerRpc |
Comment on lines
+4
to
+6
| using ILogger = Microsoft.Extensions.Logging.ILogger; | ||
| using ILoggerRpc = DiscordRPC.Logging.ILogger; | ||
| using LogLevel = DiscordRPC.Logging.LogLevel; |
Owner
There was a problem hiding this comment.
required change: Use fully qualified naming instead of aliases for ambiguities.
| using ILoggerRpc = DiscordRPC.Logging.ILogger; | ||
| using LogLevel = DiscordRPC.Logging.LogLevel; | ||
|
|
||
| namespace Hi3Helper.SharpDiscordRPC.DiscordRPC.Logging |
Owner
There was a problem hiding this comment.
required change: must be the same namespace as the rest of the project.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal: Implement a wrapper for Microsoft's ILogger implementation
This is to make it easier for other project to start implementing this project as Microsoft's ILogger implementation is a standard. This PR is based on our project's implementation but modified to fit in the base repo TargetFrameworks
Unfortunately, I don't seem to able to implement it for net45 TargetFramework for some reason, so it's currently disabled with constants at the moment for that framework. A hand on that would be greatly appreciated.