-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from bing-framework/dev_3.1
Dev 3.1
- Loading branch information
Showing
23 changed files
with
566 additions
and
91 deletions.
There are no files selected for viewing
This file contains 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
24 changes: 24 additions & 0 deletions
24
framework/src/Bing.Logging/Bing/Logging/BingLoggingBuilder.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Bing.Logging | ||
{ | ||
/// <summary> | ||
/// 日志构建器 | ||
/// </summary> | ||
public sealed class BingLoggingBuilder | ||
{ | ||
/// <summary> | ||
/// 初始化一个<see cref="BingLoggingBuilder"/>类型的实例 | ||
/// </summary> | ||
/// <param name="services">服务集合</param> | ||
public BingLoggingBuilder(IServiceCollection services) | ||
{ | ||
Services = services; | ||
} | ||
|
||
/// <summary> | ||
/// 服务集合 | ||
/// </summary> | ||
public IServiceCollection Services { get; } | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
framework/src/Bing.Logging/Bing/Logging/BingLoggingOptions.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Bing.Logging | ||
{ | ||
/// <summary> | ||
/// Bing 日志选项配置 | ||
/// </summary> | ||
public class BingLoggingOptions | ||
{ | ||
/// <summary> | ||
/// 初始化一个<see cref="BingLoggingOptions"/>类型的实例 | ||
/// </summary> | ||
public BingLoggingOptions() | ||
{ | ||
ClearProviders = false; | ||
Extensions = new List<IBingLoggingOptionsExtension>(); | ||
} | ||
|
||
/// <summary> | ||
/// 日志选项扩展列表 | ||
/// </summary> | ||
internal IList<IBingLoggingOptionsExtension> Extensions { get; } | ||
|
||
/// <summary> | ||
/// 是否清空日志提供程序 | ||
/// </summary> | ||
public bool ClearProviders { get; set; } | ||
|
||
/// <summary> | ||
/// 注册扩展 | ||
/// </summary> | ||
/// <param name="extension">日志选项配置扩展</param> | ||
public void RegisterExtension(IBingLoggingOptionsExtension extension) | ||
{ | ||
if (extension == null) | ||
throw new ArgumentNullException(nameof(extension)); | ||
Extensions.Add(extension); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
framework/src/Bing.Logging/Bing/Logging/IBingLoggingOptionsExtension.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Bing.Logging | ||
{ | ||
/// <summary> | ||
/// Bing 日志选项配置扩展 | ||
/// </summary> | ||
public interface IBingLoggingOptionsExtension | ||
{ | ||
/// <summary> | ||
/// 注册子服务 | ||
/// </summary> | ||
/// <param name="services">服务集合</param> | ||
void AddServices(IServiceCollection services); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
|
||
namespace Bing.Logging | ||
{ | ||
/// <summary> | ||
/// 日志操作工厂 | ||
/// </summary> | ||
public interface ILogFactory | ||
{ | ||
/// <summary> | ||
/// 创建日志操作 | ||
/// </summary> | ||
/// <param name="categoryName">日志类别</param> | ||
ILog CreateLog(string categoryName); | ||
|
||
/// <summary> | ||
/// 创建日志操作 | ||
/// </summary> | ||
/// <param name="type">日志类别类型</param> | ||
ILog CreateLog(Type type); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.