< Summary - Kestrun — Combined Coverage

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

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Enriches log events with properties from LogContext
 4    .DESCRIPTION
 5        Enriches log events with properties from LogContext. Use Push-LogContextProp to add properties.
 6    .PARAMETER LoggerConfig
 7        Instance of LoggerConfiguration that is already setup.
 8    .INPUTS
 9        Instance of LoggerConfiguration
 10    .OUTPUTS
 11        Instance of LoggerConfiguration
 12    .EXAMPLE
 13        PS> New-KrLogger | Add-KrEnrichFromLogContext | Add-KrSinkConsole | Register-KrLogger
 14#>
 15function Add-KrEnrichFromLogContext {
 16    [KestrunRuntimeApi('Everywhere')]
 17    [OutputType([Serilog.LoggerConfiguration])]
 18    [CmdletBinding()]
 19    param(
 20        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
 21        [Serilog.LoggerConfiguration]$LoggerConfig
 22    )
 23
 24    process {
 025        return $LoggerConfig.Enrich.FromLogContext()
 26    }
 27}
 28

Methods/Properties

Add-KrEnrichFromLogContext()