Skip to content

Commit

Permalink
move folder and fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Dec 4, 2023
1 parent b94b4a9 commit 2153f63
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 33 deletions.
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
File renamed without changes.

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
File renamed without changes
File renamed without changes

0 comments on commit 2153f63

Please sign in to comment.