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

22 lines
491 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;
}
2021-12-09 11:42:06 -05:00
if ($Global:Icinga.Protected.DebugMode -eq $FALSE) {
return;
}
[array]$DebugContent = @($Message);
$DebugContent += $Objects;
Write-IcingaEventMessage -EventId 1000 -Namespace 'Debug' -ExceptionObject $ExceptionObject -Objects $DebugContent;
}