mirror of
https://github.com/prometheus-community/ipmi_exporter
synced 2024-12-23 06:22:30 +00:00
fix unsupported value type in debug logs due to attempting to log structs directly
Signed-off-by: snaar <snaar@snaar.net>
This commit is contained in:
parent
b806738818
commit
6cf04baf94
@ -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
Block a user