icinga-powershell-framework/lib/core/logging/Write-IcingaDebugMessage.psm1
2024-02-02 10:48:09 +01:00

23 lines
519 B
PowerShell

function Write-IcingaDebugMessage()
{
param (
[string]$Message,
[array]$Objects = @(),
$ExceptionObject = $null
);
if ([string]::IsNullOrEmpty($Message)) {
return;
}
if ($Global:Icinga.Protected.DebugMode -eq $FALSE) {
return;
}
[array]$DebugContent = @($Message);
$DebugContent += $Objects;
Write-IcingaEventMessage -EventId 1000 -Namespace 'Debug' -ExceptionObject $ExceptionObject -Objects $DebugContent;
$DebugContent = $null;
}