-
-
Notifications
You must be signed in to change notification settings - Fork 113
Implement Microsoft.Extensions.Logger Wrapper #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Only works for netstandard2.0 at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some changes. Overall a good idea to implement that standard interface.
@@ -7,6 +7,10 @@ | |||
using DiscordRPC.RPC; | |||
using DiscordRPC.RPC.Commands; | |||
using System; | |||
#if !DISABLE_MSLOGGEREXTENSION | |||
using Hi3Helper.SharpDiscordRPC.DiscordRPC.Logging; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required change: Use the same namespace from the project
@@ -7,6 +7,10 @@ | |||
using DiscordRPC.RPC; | |||
using DiscordRPC.RPC.Commands; | |||
using System; | |||
#if !DISABLE_MSLOGGEREXTENSION | |||
using Hi3Helper.SharpDiscordRPC.DiscordRPC.Logging; | |||
using ILoggerMs = Microsoft.Extensions.Logging.ILogger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-pick: Rename to MsLogger
using ILogger = Microsoft.Extensions.Logging.ILogger; | ||
using ILoggerRpc = DiscordRPC.Logging.ILogger; | ||
using LogLevel = DiscordRPC.Logging.LogLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required change: must be the same namespace as the rest of the project.
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.