namespace ZB.MOM.WW.OtOpcUa.Core.Scripting;
///
/// DI-friendly holder for the root script so it can be
/// injected into the Roslyn evaluators without clashing with the application's main
/// Serilog.Log.Logger (both are ; a wrapper type
/// gives the container an unambiguous registration to resolve).
///
///
/// The wrapped logger is the composed script pipeline — a rolling scripts-*.log
/// file sink, the mirroring errors to the main log,
/// and the fanning entries onto the cluster
/// script-logs topic for the live Script-log Admin UI page.
///
/// Implements so the DI container flushes the rolling-file
/// sink on graceful host shutdown.
///
///
public sealed class ScriptRootLogger : IDisposable
{
private readonly Serilog.Core.Logger _logger;
/// The composed root script logger (file + companion mirror + DPS topic sink).
public Serilog.ILogger Logger => _logger;
/// Initializes a new .
/// The composed Serilog logger; owned + disposed by this wrapper.
public ScriptRootLogger(Serilog.Core.Logger logger) =>
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
/// Disposes the underlying logger, flushing the rolling-file sink.
public void Dispose() => _logger.Dispose();
}