feat(scripting): root script logger + DPS publisher wired in Host
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
namespace ZB.MOM.WW.OtOpcUa.Core.Scripting;
|
||||
|
||||
/// <summary>
|
||||
/// DI-friendly holder for the root script <see cref="Serilog.ILogger"/> so it can be
|
||||
/// injected into the Roslyn evaluators without clashing with the application's main
|
||||
/// <c>Serilog.Log.Logger</c> (both are <see cref="Serilog.ILogger"/>; a wrapper type
|
||||
/// gives the container an unambiguous registration to resolve).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The wrapped logger is the composed script pipeline — a rolling <c>scripts-*.log</c>
|
||||
/// file sink, the <see cref="ScriptLogCompanionSink"/> mirroring errors to the main log,
|
||||
/// and the <see cref="ScriptLogTopicSink"/> fanning entries onto the cluster
|
||||
/// <c>script-logs</c> topic for the live Script-log Admin UI page.
|
||||
/// </remarks>
|
||||
public sealed class ScriptRootLogger
|
||||
{
|
||||
/// <summary>Gets the composed root script logger that evaluators derive per-script loggers from.</summary>
|
||||
public Serilog.ILogger Logger { get; }
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="ScriptRootLogger"/> class.</summary>
|
||||
/// <param name="logger">The composed root script logger. Must not be <c>null</c>.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown when <paramref name="logger"/> is <c>null</c>.</exception>
|
||||
public ScriptRootLogger(Serilog.ILogger logger) =>
|
||||
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
Reference in New Issue
Block a user