using NCC.Dependency; using Microsoft.Extensions.Logging; using System; namespace NCC.Logging { /// /// 构建字符串日志部分类 /// [SuppressSniffer] public sealed partial class StringLoggingPart { /// /// 静态缺省日志部件 /// public static StringLoggingPart Default => new(); /// /// 日志内容 /// public string Message { get; private set; } /// /// 日志级别 /// public LogLevel Level { get; private set; } = LogLevel.Information; /// /// 消息格式化参数 /// public object[] Args { get; private set; } /// /// 事件 Id /// public EventId? EventId { get; private set; } /// /// 日志分类类型(从依赖注入中解析) /// public Type CategoryType { get; private set; } = typeof(System.Running.Logging); /// /// 日志分类名(总是创建新的实例) /// public string CategoryName { get; private set; } /// /// 异常对象 /// public Exception Exception { get; private set; } /// /// 日志对象所在作用域 /// public IServiceProvider LoggerScoped { get; private set; } } }