< Summary - Kestrun — Combined Coverage

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

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Enriches log events with ErrorRecord property if available.
 4    .DESCRIPTION
 5        Enriches log events with ErrorRecord property if available. Use -ErrorRecord parameter on Write-*Log cmdlets to 
 6    .PARAMETER LoggerConfig
 7        Instance of LoggerConfiguration that is already setup.
 8    .PARAMETER DestructureObjects
 9        If true, and the value is a non-primitive, non-array type, then the value will be converted to a structure; othe
 10    .INPUTS
 11        Instance of LoggerConfiguration
 12    .OUTPUTS
 13        Instance of LoggerConfiguration
 14    .EXAMPLE
 15        PS> New-KrLogger | Add-KrEnrichErrorRecord | Add-KrSinkPowerShell | Register-KrLogger
 16#>
 17function Add-KrEnrichErrorRecord {
 18    [KestrunRuntimeApi('Everywhere')]
 19    [OutputType([Serilog.LoggerConfiguration])]
 20    [CmdletBinding()]
 21    param(
 22        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
 23        [Serilog.LoggerConfiguration]$LoggerConfig,
 24        [Parameter(Mandatory = $false)]
 25        [switch]$DestructureObjects
 26    )
 27
 28    process {
 029        return [PoShLog.Core.Enrichers.Extensions.ErrorRecordEnricherExtensions]::WithErrorRecord($LoggerConfig.Enrich, 
 30    }
 31}
 32

Methods/Properties

Add-KrEnrichErrorRecord()