From d0797b7f381c4b1730addead308444301635927b Mon Sep 17 00:00:00 2001 From: nickscript0 Date: Sat, 22 Aug 2015 14:03:30 -0600 Subject: [PATCH] Log plugin errors in crankParallel and crankSeparate cases. Previously errors weren't logged in these cases. --- agent.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agent.go b/agent.go index 1c90bf1a4..3f8132018 100644 --- a/agent.go +++ b/agent.go @@ -179,7 +179,11 @@ func (a *Agent) crankParallel() error { acc.Prefix = plugin.name + "_" acc.Config = plugin.config - plugin.plugin.Gather(&acc) + err := plugin.plugin.Gather(&acc) + if err != nil { + log.Printf("Error in plugins: %s", err) + } + points <- &acc }(plugin) @@ -333,7 +337,10 @@ func (a *Agent) Run(shutdown chan struct{}) error { wg.Add(1) go func(plugin *runningPlugin) { defer wg.Done() - a.crankSeparate(shutdown, plugin) + err := a.crankSeparate(shutdown, plugin) + if err != nil { + log.Printf("Error in plugins: %s", err) + } }(plugin) } }