using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace PCL.Core.Logging;
///
/// Microsoft.Extensions.Logging.ILogger 适配器
/// 将现有的 Logger 包装为标准的 ILogger 接口实现
///
public class LoggerAdapter(Logger logger, string categoryName) : ILogger
{
private readonly Logger _innerLogger = logger ?? throw new ArgumentNullException(nameof(logger));
private readonly string _categoryName = categoryName ?? throw new ArgumentNullException(nameof(categoryName));
private static readonly AsyncLocal> _ScopeStack = new();
IDisposable ILogger.BeginScope(TState state)
{
_ScopeStack.Value ??= new Stack