Refactor logs

This commit is contained in:
2020-02-03 19:15:51 +01:00
parent 5e9b47970a
commit dca1c25f11
5 changed files with 27 additions and 19 deletions

View File

@ -67,9 +67,10 @@ func (p *Pca9685Part) onThrottleChange(_ MQTT.Client, message MQTT.Message) {
var throttle events.ThrottleMessage
err := proto.Unmarshal(message.Payload(), &throttle)
if err != nil {
log.Infof("[%v] unable to unmarshall throttle msg: %v", message.Topic(), err)
log.Warningf("[%v] unable to unmarshall throttle msg: %v", message.Topic(), err)
return
}
log.Debugf("new throttle value: %v", throttle.GetThrottle())
p.muThrottle.Lock()
defer p.muThrottle.Unlock()
p.throttleCtrl.SetPercentValue(throttle.GetThrottle())
@ -79,7 +80,7 @@ func (p *Pca9685Part) onSteeringChange(_ MQTT.Client, message MQTT.Message) {
var steering events.SteeringMessage
err := proto.Unmarshal(message.Payload(), &steering)
if err != nil {
log.Infof("[%v] unable to unmarshall steering msg: %v", message.Topic(), err)
log.Warningf("[%v] unable to unmarshal steering msg: %v", message.Topic(), err)
return
}
p.muSteering.Lock()