< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Logging.Sinks.Extensions.PowerShellSinkExtensions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Sinks/Extensions/PowerShellSinkExtensions.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 28
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
PowerShell(...)100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Sinks/Extensions/PowerShellSinkExtensions.cs

#LineLine coverage
 1using Serilog;
 2using Serilog.Configuration;
 3using Serilog.Core;
 4using Serilog.Events;
 5
 6
 7namespace Kestrun.Logging.Sinks.Extensions;
 8
 9/// <summary>
 10/// Provides extension methods for configuring PowerShell sinks in Serilog logging.
 11/// </summary>
 12public static class PowerShellSinkExtensions
 13{
 14    /// <summary>
 15    /// Adds a PowerShell sink to the Serilog logger configuration.
 16    /// </summary>
 17    /// <param name="loggerConfiguration">The logger sink configuration.</param>
 18    /// <param name="callback">Callback to handle log events and formatted output.</param>
 19    /// <param name="restrictedToMinimumLevel">The minimum level for events passed through the sink.</param>
 20    /// <param name="outputTemplate">The output template for formatting log messages.</param>
 21    /// <param name="levelSwitch">Optional level switch for controlling logging level.</param>
 22    /// <returns>The logger configuration with the PowerShell sink added.</returns>
 23    public static LoggerConfiguration PowerShell(this LoggerSinkConfiguration loggerConfiguration,
 24        Action<LogEvent, string> callback,
 25        LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
 26        string outputTemplate = PowerShellSink.DEFAULT_OUTPUT_TEMPLATE,
 527        LoggingLevelSwitch? levelSwitch = null) => loggerConfiguration.Sink(new PowerShellSink(callback, outputTemplate)
 28}