icinga-powershell-framework/lib/core/logging/Write-IcingaDebugMessage.psm1

22 lines
534 B
PowerShell
Raw Normal View History

function Write-IcingaDebugMessage()
{
2022-01-12 03:53:28 -05:00
param (
[string]$Message,
2022-01-12 03:53:28 -05:00
[array]$Objects = @(),
$ExceptionObject = $null
);
if ([string]::IsNullOrEmpty($Message)) {
return;
}
if ($null -eq $global:IcingaDaemonData -Or $global:IcingaDaemonData.DebugMode -eq $FALSE) {
return;
}
[array]$DebugContent = @($Message);
$DebugContent += $Objects;
2022-01-12 03:53:28 -05:00
Write-IcingaEventMessage -EventId 1000 -Namespace 'Framework' -ExceptionObject $ExceptionObject -Objects $DebugContent;
}