From a3074739c0df3087ecda17d039b61f06c4a1c87c Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Wed, 29 Jul 2020 15:35:10 +0200 Subject: [PATCH] Adds debug output for performance counter initialising --- .../New-IcingaPerformanceCounterObject.psm1 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/core/perfcounter/New-IcingaPerformanceCounterObject.psm1 b/lib/core/perfcounter/New-IcingaPerformanceCounterObject.psm1 index 71d09c5..7c6c884 100644 --- a/lib/core/perfcounter/New-IcingaPerformanceCounterObject.psm1 +++ b/lib/core/perfcounter/New-IcingaPerformanceCounterObject.psm1 @@ -28,17 +28,10 @@ $pc_instance | Add-Member -membertype NoteProperty -name 'SkipWait' -value $SkipWait; $pc_instance | Add-Member -membertype ScriptMethod -name 'Init' -value { - - # TODO: Re-Implement debug logging - <#$Icinga2.Log.Write( - $Icinga2.Enums.LogState.Debug, - [string]::Format('Creating new Counter for Category {0} with Instance {1} and Counter {2}. Full Name "{3}"', - $this.Category, - $this.Instance, - $this.Counter, - $this.FullName - ) - );#> + + Write-IcingaConsoleDebug ` + -Message 'Creating new Counter for Category "{0}" with Instance "{1}" and Counter "{2}". Full Name "{3}"' ` + -Objects $this.Category, $this.Instance, $this.Counter, $this.FullName; # Create the Performance Counter object we want to access $this.PerfCounter = New-Object System.Diagnostics.PerformanceCounter;