< Summary - Kestrun — Combined Coverage

Information
Class: Public.Logging.enrichers.Add-KrEnrichProcessId
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Logging/enrichers/Add-KrEnrichProcessId.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 31
Line coverage: 0%
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

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Logging/enrichers/Add-KrEnrichProcessId.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Adds the process ID to the log context.
 4    .DESCRIPTION
 5        Adds the process ID to the log context, allowing it to be included in log events.
 6    .PARAMETER LoggerConfig
 7        Instance of LoggerConfiguration
 8    .INPUTS
 9        None
 10    .OUTPUTS
 11        LoggerConfiguration object allowing method chaining
 12    .EXAMPLE
 13        PS> New-KrLogger | Add-KrEnrichProcessId | Register-KrLogger
 14    .NOTES
 15        This function is part of the Kestrun logging infrastructure and should be used to enrich log events with process
 16        https://github.com/serilog/serilog-enrichers-process
 17#>
 18function Add-KrEnrichProcessId {
 19    [KestrunRuntimeApi('Everywhere')]
 20    [OutputType([Serilog.LoggerConfiguration])]
 21    [CmdletBinding()]
 22    param(
 23        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
 24        [Serilog.LoggerConfiguration]$loggerConfig
 25    )
 26
 27    process {
 028        return [Serilog.ProcessLoggerConfigurationExtensions]::WithProcessId($loggerConfig.Enrich)
 29    }
 30}
 31

Methods/Properties

Add-KrEnrichProcessId()