diff --git a/src/CSharp/EasyMicroservices.Logger. Log4net/EasyMicroservices.Logger.Log4net.csproj b/src/CSharp/EasyMicroservices.Logger. Log4net/EasyMicroservices.Logger.Log4net.csproj index 403d05d..aaa74f1 100644 --- a/src/CSharp/EasyMicroservices.Logger. Log4net/EasyMicroservices.Logger.Log4net.csproj +++ b/src/CSharp/EasyMicroservices.Logger. Log4net/EasyMicroservices.Logger.Log4net.csproj @@ -17,7 +17,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 logger wrapper EasyMicroservices@gmail.com log,logger,logging,log4net diff --git a/src/CSharp/EasyMicroservices.Logger.DependencyInjection/EasyMicroservices.Logger.DependencyInjection.csproj b/src/CSharp/EasyMicroservices.Logger.DependencyInjection/EasyMicroservices.Logger.DependencyInjection.csproj index 01b79ee..ea5d1d8 100644 --- a/src/CSharp/EasyMicroservices.Logger.DependencyInjection/EasyMicroservices.Logger.DependencyInjection.csproj +++ b/src/CSharp/EasyMicroservices.Logger.DependencyInjection/EasyMicroservices.Logger.DependencyInjection.csproj @@ -17,7 +17,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 logger wrapper EasyMicroservices@gmail.com log,logger,logging diff --git a/src/CSharp/EasyMicroservices.Logger.DependencyInjection/LoggerExtensions.cs b/src/CSharp/EasyMicroservices.Logger.DependencyInjection/LoggerExtensions.cs index daea9ec..25b130f 100644 --- a/src/CSharp/EasyMicroservices.Logger.DependencyInjection/LoggerExtensions.cs +++ b/src/CSharp/EasyMicroservices.Logger.DependencyInjection/LoggerExtensions.cs @@ -31,7 +31,7 @@ public static IServiceCollection AddLoggerScoped(this IServiceCollection service options.ThrowIfNull(nameof(options)); options(new LoggerOption()); services.AddScoped(service => LoggerOptionBuilder.GetLogger()); - services.AddScoped(service => LoggerOptionBuilder.GetLogger()); + services.AddScoped(service => LoggerOptionBuilder.GetLogger()); return services; } @@ -46,7 +46,7 @@ public static IServiceCollection AddLoggerTransient(this IServiceCollection serv options.ThrowIfNull(nameof(options)); options(new LoggerOption()); services.AddTransient(service => LoggerOptionBuilder.GetLogger()); - services.AddTransient(service => LoggerOptionBuilder.GetLogger()); + services.AddTransient(service => LoggerOptionBuilder.GetLogger()); return services; } @@ -61,7 +61,7 @@ public static IServiceCollection AddLoggerSingleton(this IServiceCollection serv options.ThrowIfNull(nameof(options)); options(new LoggerOption()); services.AddSingleton(service => LoggerOptionBuilder.GetLogger()); - services.AddSingleton(service => LoggerOptionBuilder.GetLogger()); + services.AddSingleton(service => LoggerOptionBuilder.GetLogger()); return services; } } diff --git a/src/CSharp/EasyMicroservices.Logger.Logary/EasyMicroservices.Logger.Logary.csproj b/src/CSharp/EasyMicroservices.Logger.Logary/EasyMicroservices.Logger.Logary.csproj new file mode 100644 index 0000000..f7384f6 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Logary/EasyMicroservices.Logger.Logary.csproj @@ -0,0 +1,38 @@ + + + + + + net7.0 + + + + + netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net48;net7.0 + + + + + + AnyCPU;x64;x86 + EasyMicroservices + true + 0.0.0.6 + logger wrapper + EasyMicroservices@gmail.com + log,logger,logging,logary + https://github.com/EasyMicroservices/Logger + latest + true + .\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.Logger.Logary.xml + + + + + + + + + + + diff --git a/src/CSharp/EasyMicroservices.Logger.Logary/LogaryExtensions.cs b/src/CSharp/EasyMicroservices.Logger.Logary/LogaryExtensions.cs new file mode 100644 index 0000000..45d71c7 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Logary/LogaryExtensions.cs @@ -0,0 +1,27 @@ +using EasyMicroservices.Logger.Logary.Providers; +using EasyMicroservices.Logger.Options; +using Logary; +using System; + +namespace Microsoft.Extensions.DependencyInjection +{ + /// + /// + /// + public static class LogaryExtensions + { + /// + /// + /// + /// + /// + /// + public static LoggerOption UseLogary(this LoggerOption options, Logger logger) + { + options.ThrowIfNull(nameof(options)); + logger.ThrowIfNull(nameof(logger)); + LoggerOptionBuilder.UseLogger(() => new LogaryProvider(logger)); + return options; + } + } +} diff --git a/src/CSharp/EasyMicroservices.Logger.Logary/Providers/LogaryProvider.cs b/src/CSharp/EasyMicroservices.Logger.Logary/Providers/LogaryProvider.cs new file mode 100644 index 0000000..4b56fa8 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Logary/Providers/LogaryProvider.cs @@ -0,0 +1,108 @@ +using EasyMicroservices.Logger.Providers; +using EasyMicroservices.ServiceContracts; +using Logary; +using System; +using System.Linq; + +namespace EasyMicroservices.Logger.Logary.Providers; +/// +/// +/// +public class LogaryProvider : BaseProvider +{ + readonly global::Logary.Logger _logger; + /// + /// + /// + /// + public LogaryProvider(global::Logary.Logger logger) + { + _logger = logger; + } + + /// + /// + /// + public LogaryProvider() + { + _logger = global::Logary.Log.Create("Default"); + } + + MessageContract Log(object[] args, LogLevel logLevel) + { + var extracted = Extract(args); + AddNotExistItems(extracted); + var message = MessageModule.Event(logLevel, $"{extracted.Messages.First()}"); + _logger.logWithAck(true, logLevel, Microsoft.FSharp.Core.FuncConvert.FromFunc((x) => message)); + if (extracted.HasExceptions) + { + var errormessage = MessageModule.Event(logLevel, $"{extracted.Exceptions.First()}"); + _logger.logWithAck(true, logLevel, Microsoft.FSharp.Core.FuncConvert.FromFunc((x) => errormessage)); + } + + return (MessageContract)true; + } + + /// + /// + /// + /// + /// + public override MessageContract Verbose(params object[] args) + { + return Log(args, LogLevel.Verbose); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Debug(params object[] args) + { + return Log(args, LogLevel.Debug); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Information(params object[] args) + { + return Log(args, LogLevel.Info); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Warning(params object[] args) + { + return Log(args, LogLevel.Warn); + } + + /// + /// + /// + /// + /// + public override MessageContract Error(params object[] args) + { + return Log(args, LogLevel.Error); + } + + /// + /// + /// + /// + /// + public override MessageContract Fatal(params object[] args) + { + return Log(args, LogLevel.Fatal); + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.Loupe/EasyMicroservices.Logger.Loupe.csproj b/src/CSharp/EasyMicroservices.Logger.Loupe/EasyMicroservices.Logger.Loupe.csproj new file mode 100644 index 0000000..761a69c --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Loupe/EasyMicroservices.Logger.Loupe.csproj @@ -0,0 +1,38 @@ + + + + + + net7.0 + + + + + netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net48;net7.0 + + + + + + AnyCPU;x64;x86 + EasyMicroservices + true + 0.0.0.6 + logger wrapper + EasyMicroservices@gmail.com + log,logger,logging,loupe + https://github.com/EasyMicroservices/Logger + latest + true + .\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.Logger.Loupe.xml + + + + + + + + + + + diff --git a/src/CSharp/EasyMicroservices.Logger.Loupe/LoupeExtensions.cs b/src/CSharp/EasyMicroservices.Logger.Loupe/LoupeExtensions.cs new file mode 100644 index 0000000..1663973 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Loupe/LoupeExtensions.cs @@ -0,0 +1,24 @@ +using EasyMicroservices.Logger.Loupe.Providers; +using EasyMicroservices.Logger.Options; +using System; + +namespace Microsoft.Extensions.DependencyInjection +{ + /// + /// + /// + public static class LoupeExtensions + { + /// + /// + /// + /// + /// + public static LoggerOption UseLoupe(this LoggerOption options) + { + options.ThrowIfNull(nameof(options)); + LoggerOptionBuilder.UseLogger(() => new LoupeProvider()); + return options; + } + } +} diff --git a/src/CSharp/EasyMicroservices.Logger.Loupe/Providers/LoupeProvider.cs b/src/CSharp/EasyMicroservices.Logger.Loupe/Providers/LoupeProvider.cs new file mode 100644 index 0000000..7c07577 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Loupe/Providers/LoupeProvider.cs @@ -0,0 +1,93 @@ +using EasyMicroservices.Logger.Providers; +using EasyMicroservices.ServiceContracts; +using Gibraltar.Agent; +using System; +using System.Linq; + +namespace EasyMicroservices.Logger.Loupe.Providers; +/// +/// +/// +public class LoupeProvider : BaseProvider +{ + /// + /// + /// + public LoupeProvider() + { + + } + + MessageContract InternalLog(object[] args, Action action) + { + var extracted = Extract(args); + AddNotExistItems(extracted); + action($"{extracted.Messages.First()}", null); + if (extracted.HasExceptions) + action($"{extracted.Exceptions.First()}", null); + return (MessageContract)true; + } + + /// + /// + /// + /// + /// + public override MessageContract Verbose(params object[] args) + { + return InternalLog(args, Log.TraceVerbose); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Debug(params object[] args) + { + return InternalLog(args, Log.TraceVerbose); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Information(params object[] args) + { + return InternalLog(args, Log.TraceInformation); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Warning(params object[] args) + { + return InternalLog(args, Log.TraceWarning); + } + + /// + /// + /// + /// + /// + public override MessageContract Error(params object[] args) + { + return InternalLog(args, Log.TraceError); + } + + /// + /// + /// + /// + /// + public override MessageContract Fatal(params object[] args) + { + return InternalLog(args, Log.TraceCritical); + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.NLog/EasyMicroservices.Logger.NLog.csproj b/src/CSharp/EasyMicroservices.Logger.NLog/EasyMicroservices.Logger.NLog.csproj index 3dbde58..3d7b3f9 100644 --- a/src/CSharp/EasyMicroservices.Logger.NLog/EasyMicroservices.Logger.NLog.csproj +++ b/src/CSharp/EasyMicroservices.Logger.NLog/EasyMicroservices.Logger.NLog.csproj @@ -17,7 +17,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 logger wrapper EasyMicroservices@gmail.com log,logger,logging,nlog diff --git a/src/CSharp/EasyMicroservices.Logger.Sentry/EasyMicroservices.Logger.Sentry.csproj b/src/CSharp/EasyMicroservices.Logger.Sentry/EasyMicroservices.Logger.Sentry.csproj new file mode 100644 index 0000000..51ff1ae --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Sentry/EasyMicroservices.Logger.Sentry.csproj @@ -0,0 +1,38 @@ + + + + + + net7.0 + + + + + netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net48;net7.0 + + + + + + AnyCPU;x64;x86 + EasyMicroservices + true + 0.0.0.6 + logger wrapper + EasyMicroservices@gmail.com + log,logger,logging,sentry + https://github.com/EasyMicroservices/Logger + latest + true + .\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.Logger.Sentry.xml + + + + + + + + + + + diff --git a/src/CSharp/EasyMicroservices.Logger.Sentry/Providers/SentryProvider.cs b/src/CSharp/EasyMicroservices.Logger.Sentry/Providers/SentryProvider.cs new file mode 100644 index 0000000..a98e66d --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Sentry/Providers/SentryProvider.cs @@ -0,0 +1,105 @@ +using EasyMicroservices.Logger.Providers; +using EasyMicroservices.ServiceContracts; +using Sentry; +using System; +using System.Linq; + +namespace EasyMicroservices.Logger.Sentry.Providers; +/// +/// +/// +public class SentryProvider : BaseProvider +{ + /// + /// + /// + public SentryProvider() + { + //using (SentrySdk.Init(o => { + // // Tells which project in Sentry to send events to: + // o.Dsn = "https://@sentry.io/"; + // // When configuring for the first time, to see what the SDK is doing: + // o.Debug = true; + // // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + // // We recommend adjusting this value in production. + // o.TracesSampleRate = 1.0; + //})) + //{ + + // // App code goes here - Disposing will flush events out + //} + } + + MessageContract InternalLog(object[] args, SentryLevel sentryLevel, Func action) + { + var extracted = Extract(args); + AddNotExistItems(extracted); + action($"{extracted.Messages.First()}", sentryLevel); + if (extracted.HasExceptions) + action($"{extracted.Exceptions.First()}", sentryLevel); + return (MessageContract)true; + } + + /// + /// + /// + /// + /// + public override MessageContract Verbose(params object[] args) + { + return InternalLog(args, SentryLevel.Debug, SentrySdk.CaptureMessage); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Debug(params object[] args) + { + return InternalLog(args, SentryLevel.Debug, SentrySdk.CaptureMessage); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Information(params object[] args) + { + return InternalLog(args, SentryLevel.Info, SentrySdk.CaptureMessage); + } + + /// + /// + /// + /// + /// + /// + public override MessageContract Warning(params object[] args) + { + return InternalLog(args, SentryLevel.Warning, SentrySdk.CaptureMessage); + } + + /// + /// + /// + /// + /// + public override MessageContract Error(params object[] args) + { + return InternalLog(args, SentryLevel.Error, SentrySdk.CaptureMessage); + } + + /// + /// + /// + /// + /// + public override MessageContract Fatal(params object[] args) + { + return InternalLog(args, SentryLevel.Fatal, SentrySdk.CaptureMessage); + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.Sentry/SentryExtensions.cs b/src/CSharp/EasyMicroservices.Logger.Sentry/SentryExtensions.cs new file mode 100644 index 0000000..5ad3ee1 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Sentry/SentryExtensions.cs @@ -0,0 +1,24 @@ +using EasyMicroservices.Logger.Sentry.Providers; +using EasyMicroservices.Logger.Options; +using System; + +namespace Microsoft.Extensions.DependencyInjection +{ + /// + /// + /// + public static class SentryExtensions + { + /// + /// + /// + /// + /// + public static LoggerOption UseSentry(this LoggerOption options) + { + options.ThrowIfNull(nameof(options)); + LoggerOptionBuilder.UseLogger(() => new SentryProvider()); + return options; + } + } +} diff --git a/src/CSharp/EasyMicroservices.Logger.Serilog/EasyMicroservices.Logger.Serilog.csproj b/src/CSharp/EasyMicroservices.Logger.Serilog/EasyMicroservices.Logger.Serilog.csproj index b77339a..67524ff 100644 --- a/src/CSharp/EasyMicroservices.Logger.Serilog/EasyMicroservices.Logger.Serilog.csproj +++ b/src/CSharp/EasyMicroservices.Logger.Serilog/EasyMicroservices.Logger.Serilog.csproj @@ -17,7 +17,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 logger wrapper EasyMicroservices@gmail.com log,logger,logging,serilog diff --git a/src/CSharp/EasyMicroservices.Logger.Tests/BaseProviderAsyncTest.cs b/src/CSharp/EasyMicroservices.Logger.Tests/BaseProviderAsyncTest.cs index afb31db..a9d10ed 100644 --- a/src/CSharp/EasyMicroservices.Logger.Tests/BaseProviderAsyncTest.cs +++ b/src/CSharp/EasyMicroservices.Logger.Tests/BaseProviderAsyncTest.cs @@ -7,8 +7,8 @@ namespace EasyMicroservices.Logger.Tests { public abstract class BaseProviderAsyncTest { - ILoggerProviderAsync _logger; - public BaseProviderAsyncTest(ILoggerProviderAsync logger) + ILoggerAsyncProvider _logger; + public BaseProviderAsyncTest(ILoggerAsyncProvider logger) { _logger = logger; } diff --git a/src/CSharp/EasyMicroservices.Logger.Tests/EasyMicroservices.Logger.Tests.csproj b/src/CSharp/EasyMicroservices.Logger.Tests/EasyMicroservices.Logger.Tests.csproj index 5a3f784..7f499ae 100644 --- a/src/CSharp/EasyMicroservices.Logger.Tests/EasyMicroservices.Logger.Tests.csproj +++ b/src/CSharp/EasyMicroservices.Logger.Tests/EasyMicroservices.Logger.Tests.csproj @@ -22,7 +22,10 @@ + + + diff --git a/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LogaryProviderTest.cs b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LogaryProviderTest.cs new file mode 100644 index 0000000..63f03c1 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LogaryProviderTest.cs @@ -0,0 +1,16 @@ +using EasyMicroservices.Logger.Logary.Providers; + +namespace EasyMicroservices.Logger.Tests.Providers; +public class LogaryProviderTest : BaseProviderTest +{ + public LogaryProviderTest() : base(new LogaryProvider()) + { + } +} + +public class LogaryProviderAsyncTest : BaseProviderAsyncTest +{ + public LogaryProviderAsyncTest() : base(new LogaryProvider()) + { + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LoupeProviderTest.cs b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LoupeProviderTest.cs new file mode 100644 index 0000000..4472ca5 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/LoupeProviderTest.cs @@ -0,0 +1,17 @@ +using EasyMicroservices.Logger.Loupe.Providers; + +namespace EasyMicroservices.Logger.Tests.Providers; + +public class LoupeProviderTest : BaseProviderTest +{ + public LoupeProviderTest() : base(new LoupeProvider()) + { + } +} + +public class LoupeProviderAsyncTest : BaseProviderAsyncTest +{ + public LoupeProviderAsyncTest() : base(new LoupeProvider()) + { + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.Tests/Providers/SentryProviderTest.cs b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/SentryProviderTest.cs new file mode 100644 index 0000000..dc3ecf4 --- /dev/null +++ b/src/CSharp/EasyMicroservices.Logger.Tests/Providers/SentryProviderTest.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using EasyMicroservices.Logger.Sentry.Providers; + +namespace EasyMicroservices.Logger.Tests.Providers; + +public class SentryProviderTest : BaseProviderTest +{ + public SentryProviderTest() : base(new SentryProvider()) + { + } +} + +public class SentryProviderAsyncTest : BaseProviderAsyncTest +{ + public SentryProviderAsyncTest() : base(new SentryProvider()) + { + } +} \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.Logger.sln b/src/CSharp/EasyMicroservices.Logger.sln index 92735fe..41094ff 100644 --- a/src/CSharp/EasyMicroservices.Logger.sln +++ b/src/CSharp/EasyMicroservices.Logger.sln @@ -21,7 +21,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.Logger.Lo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.Logger.NLog", "EasyMicroservices.Logger.NLog\EasyMicroservices.Logger.NLog.csproj", "{82A0765F-09D8-4EC2-8A26-C5375C151C83}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyMicroservices.Logger.DependencyInjection", "EasyMicroservices.Logger.DependencyInjection\EasyMicroservices.Logger.DependencyInjection.csproj", "{B06FB19E-791E-43E7-BE00-3EC01698A1AE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.Logger.DependencyInjection", "EasyMicroservices.Logger.DependencyInjection\EasyMicroservices.Logger.DependencyInjection.csproj", "{B06FB19E-791E-43E7-BE00-3EC01698A1AE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyMicroservices.Logger.Logary", "EasyMicroservices.Logger.Logary\EasyMicroservices.Logger.Logary.csproj", "{BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyMicroservices.Logger.Loupe", "EasyMicroservices.Logger.Loupe\EasyMicroservices.Logger.Loupe.csproj", "{7E83A896-DC34-4FEF-9B50-9542D4D868F5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyMicroservices.Logger.Sentry", "EasyMicroservices.Logger.Sentry\EasyMicroservices.Logger.Sentry.csproj", "{71916D95-CCBA-4993-BBC2-633BF310C02F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -53,6 +59,18 @@ Global {B06FB19E-791E-43E7-BE00-3EC01698A1AE}.Debug|Any CPU.Build.0 = Debug|Any CPU {B06FB19E-791E-43E7-BE00-3EC01698A1AE}.Release|Any CPU.ActiveCfg = Release|Any CPU {B06FB19E-791E-43E7-BE00-3EC01698A1AE}.Release|Any CPU.Build.0 = Release|Any CPU + {BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616}.Release|Any CPU.Build.0 = Release|Any CPU + {7E83A896-DC34-4FEF-9B50-9542D4D868F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E83A896-DC34-4FEF-9B50-9542D4D868F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E83A896-DC34-4FEF-9B50-9542D4D868F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E83A896-DC34-4FEF-9B50-9542D4D868F5}.Release|Any CPU.Build.0 = Release|Any CPU + {71916D95-CCBA-4993-BBC2-633BF310C02F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71916D95-CCBA-4993-BBC2-633BF310C02F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71916D95-CCBA-4993-BBC2-633BF310C02F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71916D95-CCBA-4993-BBC2-633BF310C02F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -67,6 +85,9 @@ Global {F792825F-75B4-4A07-9091-B9D8B4698A6A} = {B41249C7-F55F-4890-A2A7-177DEA51114C} {82A0765F-09D8-4EC2-8A26-C5375C151C83} = {B41249C7-F55F-4890-A2A7-177DEA51114C} {B06FB19E-791E-43E7-BE00-3EC01698A1AE} = {B41249C7-F55F-4890-A2A7-177DEA51114C} + {BD4A3C8A-EEFF-48CC-BE66-B7A0F47A5616} = {B41249C7-F55F-4890-A2A7-177DEA51114C} + {7E83A896-DC34-4FEF-9B50-9542D4D868F5} = {B41249C7-F55F-4890-A2A7-177DEA51114C} + {71916D95-CCBA-4993-BBC2-633BF310C02F} = {B41249C7-F55F-4890-A2A7-177DEA51114C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D85582B4-E6F8-41D7-9BEC-F4C8B64DDF1B} diff --git a/src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.csproj b/src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.csproj index ed94b90..85898a8 100644 --- a/src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.csproj +++ b/src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.csproj @@ -4,7 +4,7 @@ netstandard2.0;netstandard2.1;net6.0 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 Logger and Auditing system EasyMicroservice@gmail.com logging,auditing diff --git a/src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerProviderAsync.cs b/src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerAsyncProvider.cs similarity index 95% rename from src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerProviderAsync.cs rename to src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerAsyncProvider.cs index 97d7c28..521347c 100644 --- a/src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerProviderAsync.cs +++ b/src/CSharp/EasyMicroservices.Logger/Interfaces/ILoggerAsyncProvider.cs @@ -1,4 +1,5 @@ using EasyMicroservices.ServiceContracts; +using System; using System.Threading.Tasks; namespace EasyMicroservices.Logger.Interfaces @@ -6,7 +7,7 @@ namespace EasyMicroservices.Logger.Interfaces /// /// General logger define here /// - public interface ILoggerProviderAsync : ILoggerProvider + public interface ILoggerAsyncProvider : ILoggerProvider { /// /// Verbose level log diff --git a/src/CSharp/EasyMicroservices.Logger/Models/ExtractedLogInfo.cs b/src/CSharp/EasyMicroservices.Logger/Models/ExtractedLogInfo.cs index 2d9a93d..f9cd6fa 100644 --- a/src/CSharp/EasyMicroservices.Logger/Models/ExtractedLogInfo.cs +++ b/src/CSharp/EasyMicroservices.Logger/Models/ExtractedLogInfo.cs @@ -5,6 +5,9 @@ [assembly: InternalsVisibleTo("EasyMicroservices.Logger.Serilog")] [assembly: InternalsVisibleTo("EasyMicroservices.Logger.Log4net")] [assembly: InternalsVisibleTo("EasyMicroservices.Logger.NLog")] +[assembly: InternalsVisibleTo("EasyMicroservices.Logger.Logary")] +[assembly: InternalsVisibleTo("EasyMicroservices.Logger.Loupe")] +[assembly: InternalsVisibleTo("EasyMicroservices.Logger.Sentry")] namespace EasyMicroservices.Logger.Models { diff --git a/src/CSharp/EasyMicroservices.Logger/Options/LoggerOptionBuilder.cs b/src/CSharp/EasyMicroservices.Logger/Options/LoggerOptionBuilder.cs index c125629..d66a785 100644 --- a/src/CSharp/EasyMicroservices.Logger/Options/LoggerOptionBuilder.cs +++ b/src/CSharp/EasyMicroservices.Logger/Options/LoggerOptionBuilder.cs @@ -8,13 +8,13 @@ namespace EasyMicroservices.Logger.Options /// public static class LoggerOptionBuilder { - private static Func _loggerFunc; + private static Func _loggerFunc; /// /// /// /// - public static void UseLogger(Func func) + public static void UseLogger(Func func) { if (_loggerFunc != null) throw new Exception("You set UseLogger once."); @@ -26,7 +26,7 @@ public static void UseLogger(Func func) /// /// /// - public static ILoggerProviderAsync GetLogger() + public static ILoggerAsyncProvider GetLogger() { if (_loggerFunc == null) throw new Exception("You did not set UseLogger."); diff --git a/src/CSharp/EasyMicroservices.Logger/Providers/BaseProvider.cs b/src/CSharp/EasyMicroservices.Logger/Providers/BaseProvider.cs index bb77028..32c5e78 100644 --- a/src/CSharp/EasyMicroservices.Logger/Providers/BaseProvider.cs +++ b/src/CSharp/EasyMicroservices.Logger/Providers/BaseProvider.cs @@ -10,7 +10,7 @@ namespace EasyMicroservices.Logger.Providers /// /// /// - public abstract class BaseProvider : ILoggerProviderAsync + public abstract class BaseProvider : ILoggerAsyncProvider { internal ExtractedLogInfo Extract(params object[] args) { diff --git a/src/CSharp/coverage-badge-branch.svg b/src/CSharp/coverage-badge-branch.svg index 5f65ad2..b872e82 100644 --- a/src/CSharp/coverage-badge-branch.svg +++ b/src/CSharp/coverage-badge-branch.svg @@ -1 +1 @@ - coverage: branchcoverage: branch64.28%64.28% \ No newline at end of file + coverage: branchcoverage: branch0%0% \ No newline at end of file diff --git a/src/CSharp/coverage-badge-line.svg b/src/CSharp/coverage-badge-line.svg index 51dff8c..37715c0 100644 --- a/src/CSharp/coverage-badge-line.svg +++ b/src/CSharp/coverage-badge-line.svg @@ -1 +1 @@ - coverage: linecoverage: line70.39%70.39% \ No newline at end of file + coverage: linecoverage: line0%0% \ No newline at end of file