Document and add support to input plugins for logging alias (#6357)

This commit is contained in:
Greg
2019-09-23 16:39:50 -06:00
committed by Daniel Nelson
parent e42d2e39c6
commit 817c9a69a9
111 changed files with 961 additions and 659 deletions

View File

@@ -5,7 +5,6 @@ package win_perf_counters
import (
"errors"
"fmt"
"log"
"strings"
"time"
@@ -147,6 +146,8 @@ type Win_PerfCounters struct {
CountersRefreshInterval internal.Duration
UseWildcardsExpansion bool
Log telegraf.Logger
lastRefreshed time.Time
counters []*counter
query PerformanceQuery
@@ -289,7 +290,7 @@ func (m *Win_PerfCounters) AddItem(counterPath string, objectName string, instan
m.counters = append(m.counters, newItem)
if m.PrintValid {
log.Printf("Valid: %s\n", counterPath)
m.Log.Infof("Valid: %s", counterPath)
}
}
} else {
@@ -297,7 +298,7 @@ func (m *Win_PerfCounters) AddItem(counterPath string, objectName string, instan
includeTotal, counterHandle}
m.counters = append(m.counters, newItem)
if m.PrintValid {
log.Printf("Valid: %s\n", counterPath)
m.Log.Infof("Valid: %s", counterPath)
}
}
@@ -323,7 +324,7 @@ func (m *Win_PerfCounters) ParseConfig() error {
if err != nil {
if PerfObject.FailOnMissing || PerfObject.WarnOnMissing {
log.Printf("Invalid counterPath: '%s'. Error: %s\n", counterPath, err.Error())
m.Log.Errorf("Invalid counterPath: '%s'. Error: %s\n", counterPath, err.Error())
}
if PerfObject.FailOnMissing {
return err