Merge pull request #88 from snaar/master
fix unsupported value type in debug logs due to attempting to log structs directly
This commit is contained in:
commit
e596edb616
|
@ -14,6 +14,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
|
@ -158,7 +159,7 @@ func (c IPMICollector) Collect(result freeipmi.Result, ch chan<- prometheus.Metr
|
|||
state = math.NaN()
|
||||
}
|
||||
|
||||
level.Debug(logger).Log("msg", "Got values", "data", data)
|
||||
level.Debug(logger).Log("msg", "Got values", "data", fmt.Sprintf("%+v", data))
|
||||
|
||||
switch data.Unit {
|
||||
case "RPM":
|
||||
|
|
|
@ -136,7 +136,7 @@ func Execute(cmd string, args []string, config string, target string, logger log
|
|||
target = "[local]"
|
||||
}
|
||||
|
||||
level.Debug(logger).Log("msg", "Executing", "command", cmd, "args", args)
|
||||
level.Debug(logger).Log("msg", "Executing", "command", cmd, "args", fmt.Sprintf("%+v", args))
|
||||
out, err := exec.Command(cmd, args...).CombinedOutput()
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error running %s: %s", cmd, err)
|
||||
|
|
Loading…
Reference in New Issue