From b01c28ebc6236369485bec1129e33a222c02200c Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 29 Sep 2015 14:06:49 -0700 Subject: [PATCH] Clean up additional logging and always print basic agent config --- agent.go | 8 ++++---- cmd/telegraf/telegraf.go | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/agent.go b/agent.go index abf1341b8..c1c9fcf14 100644 --- a/agent.go +++ b/agent.go @@ -220,8 +220,8 @@ func (a *Agent) crankParallel() error { } elapsed := time.Since(start) - log.Printf("Cranking default interval, gathered %d metrics from %d plugins in %s\n", - len(bp.Points), counter, elapsed) + log.Printf("Cranking default (%s) interval, gathered %d metrics from %d plugins in %s\n", + a.Interval, len(bp.Points), counter, elapsed) return a.flush(&bp) } @@ -278,8 +278,8 @@ func (a *Agent) crankSeparate(shutdown chan struct{}, plugin *runningPlugin) err } elapsed := time.Since(start) - log.Printf("Cranking separate interval, gathered %d metrics from %s in %s\n", - len(bp.Points), plugin.name, elapsed) + log.Printf("Cranking separate (%s) interval, gathered %d metrics from %s in %s\n", + plugin.config.Interval, len(bp.Points), plugin.name, elapsed) if err := a.flush(&bp); err != nil { outerr = errors.New("Error encountered processing plugins & outputs") } diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index bb1e0121d..bf53d45b2 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -132,12 +132,9 @@ func main() { log.Printf("Starting Telegraf (version %s)\n", Version) log.Printf("Loaded outputs: %s", strings.Join(outputs, " ")) log.Printf("Loaded plugins: %s", strings.Join(plugins, " ")) - if ag.Debug { - log.Printf("Debug: enabled") - log.Printf("Agent Config: Interval:%s, Debug:%#v, Hostname:%#v, "+ - "Precision:%#v, UTC: %#v\n", - ag.Interval, ag.Debug, ag.Hostname, ag.Precision, ag.UTC) - } + log.Printf("Agent Config: Interval:%s, Debug:%#v, Hostname:%#v, "+ + "Precision:%#v, UTC: %#v\n", + ag.Interval, ag.Debug, ag.Hostname, ag.Precision, ag.UTC) log.Printf("Tags enabled: %s", config.ListTags()) if *fPidfile != "" {