Cleanup logging
Some checks failed
Run tests / test (1.25) (push) Failing after 1m42s
Run tests / test (stable) (push) Failing after 1m42s

This commit is contained in:
2026-02-23 18:26:24 +01:00
parent aabfa853ec
commit 0d159020c6
2 changed files with 10 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"log"
"math/rand/v2"
"slices"
"strings"
@@ -285,7 +284,7 @@ func (drv *companionDriver) Trace(path []byte) (snr []float64, err error) {
return
}
log.Printf("trace response:\n%s", hex.Dump(data))
Logger.Debugf("trace response:\n%s", hex.Dump(data))
return
}
@@ -366,8 +365,9 @@ func (drv *companionDriver) handlePushFrame(b []byte) {
case companionPushMessageWaiting:
case companionPushLogRXData:
drv.handleRXData(b[1:])
case companionPushcompanionPushNewAdvert:
default:
log.Printf("meshcore: unhandled push %02x:\n%s", b[0], hex.Dump(b[1:]))
Logger.Warnf("meshcore: unhandled push %02x:\n%s", b[0], hex.Dump(b[1:]))
}
}
@@ -397,7 +397,7 @@ func (drv *companionDriver) handleRXData(b []byte) {
Raw: b[2:],
}:
default:
log.Printf("meshcore: raw packet channel full, dropping packet")
Logger.Warn("meshcore: raw packet channel full, dropping packet")
}
}
@@ -410,7 +410,7 @@ func (drv *companionDriver) handleRXData(b []byte) {
select {
case drv.packets <- packet:
default:
log.Printf("meshcore: packet channel full, dropping packet")
Logger.Warn("meshcore: packet channel full, dropping packet")
}
}
}
@@ -478,8 +478,6 @@ func (drv *companionDriver) sendDeviceInfo() (err error) {
drv.info.Manufacturer = decodeCString(data[19:59])
drv.info.FirmwareVersion = decodeCString(data[59:79])
log.Printf("self info: %#+v", drv.info)
return
}
@@ -494,7 +492,7 @@ func (drv *companionDriver) poll() {
}
response := frame[0]
Logger.Debugf("meshcore: handle %s (%02x, %d bytes)", companionResponseName(response), response, len(frame[1:]))
Logger.Tracef("meshcore: handle %s (%02x, %d bytes)", companionResponseName(response), response, len(frame[1:]))
switch {
case response == companionResponseError:
err := CompanionError{Code: frame[1]}