make log better
This commit is contained in:
parent
fd006cdccb
commit
ad38fcaf8d
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -113,10 +113,10 @@ func readRegs(client modbus.Client, start, qty uint16) {
|
||||||
val, err := reg.read(data[(addr-start-1)*2:])
|
val, err := reg.read(data[(addr-start-1)*2:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, errSkippableRead) {
|
if errors.Is(err, errSkippableRead) {
|
||||||
log.Printf("Couldn't parse input register data, skipping: %v", err)
|
log.Printf("Couldn't parse input register data at %d, skipping: %v", addr, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Fatalf("Couldn't parse input register data: %v", err)
|
log.Fatalf("Couldn't parse input register data at %d: %v", addr, err)
|
||||||
}
|
}
|
||||||
//fmt.Printf("%s: %v %s\n", reg.name, val, reg.unit)
|
//fmt.Printf("%s: %v %s\n", reg.name, val, reg.unit)
|
||||||
registerGauges[addr].Set(val)
|
registerGauges[addr].Set(val)
|
||||||
|
|
Loading…
Reference in a new issue