Skip to content
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

move folder and fix naming #15

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.2</Version>
<Version>0.0.0.3</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,log4net</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.1</Version>
<Version>0.0.0.3</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using EasyMicroservices.Logger.Options;
using System;

namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
///
/// </summary>
public static class LoggerExtensions
{
/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddLogger(this IServiceCollection services, Action<LoggerOption> options)
{
return AddLoggerTransient(services, options);
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddLoggerScoped(this IServiceCollection services, Action<LoggerOption> options)
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddScoped(service => LoggerOptionBuilder.GetLogger());
return services;
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddLoggerTransient(this IServiceCollection services, Action<LoggerOption> options)
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddTransient(service => LoggerOptionBuilder.GetLogger());
return services;
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddLoggerSingleton(this IServiceCollection services, Action<LoggerOption> options)
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddSingleton(service => LoggerOptionBuilder.GetLogger());
return services;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.2</Version>
<Version>0.0.0.3</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,nlog</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class NLogExtensions
/// <param name="options"></param>
/// <param name="logger"></param>
/// <returns></returns>
public static LoggerOption UseLog4net(this LoggerOption options, NLog.Logger logger)
public static LoggerOption UseNLog(this LoggerOption options, NLog.Logger logger)
{
options.ThrowIfNull(nameof(options));
logger.ThrowIfNull(nameof(logger));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.2</Version>
<Version>0.0.0.3</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,serilog</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class SerilogExtensions
/// <param name="options"></param>
/// <param name="loggerConfiguration"></param>
/// <returns></returns>
public static LoggerOption UseLog4net(this LoggerOption options, LoggerConfiguration loggerConfiguration)
public static LoggerOption UseSerilog(this LoggerOption options, LoggerConfiguration loggerConfiguration)
{
options.ThrowIfNull(nameof(options));
loggerConfiguration.ThrowIfNull(nameof(loggerConfiguration));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.2</Version>
<Version>0.0.0.3</Version>
<Description>Logger and Auditing system</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>logging,auditing</PackageTags>
Expand Down
Loading