< Summary - Kestrun — Combined Coverage

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

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Sets the logger for the current session.
 4    .DESCRIPTION
 5        Sets the specified logger as the current logger for the session.
 6    .PARAMETER  Name
 7        The name of the logger to set as the default logger.
 8    .INPUTS
 9        Instance of Serilog.ILogger
 10    .OUTPUTS
 11        None. This cmdlet does not return any output.
 12    .EXAMPLE
 13        PS> Set-KrDefaultLogger -Logger $myLogger
 14        PS> $myLogger | Set-KrDefaultLogger
 15        Sets the specified logger as the current logger for the session.
 16    .EXAMPLE
 17        PS> $myLogger | Set-KrDefaultLogger
 18        Sets the specified logger as the current logger for the session.
 19#>
 20function Set-KrDefaultLogger {
 21    [KestrunRuntimeApi('Everywhere')]
 22    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
 23    [CmdletBinding()]
 24    param(
 25        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
 26        [string]$Name
 27    )
 28
 29    process {
 030        [Kestrun.Logging.LoggerManager]::DefaultLogger = [Kestrun.Logging.LoggerManager]::Get($Name)
 31    }
 32}
 33

Methods/Properties

Set-KrDefaultLogger()