refactor(cli): rewrite log configuration

This commit is contained in:
2022-01-03 18:03:17 +01:00
parent d191e7baf1
commit 4c8ef726fa
3 changed files with 7 additions and 10 deletions

View File

@ -17,7 +17,6 @@ func NewPart(client mqtt.Client, steeringTopic, driveModeTopic, rcSteeringTopic,
rcSteeringTopic: rcSteeringTopic,
tfSteeringTopic: tfSteeringTopic,
driveMode: events.DriveMode_USER,
debug: debug,
}
}
@ -72,7 +71,7 @@ func (p *SteeringPart) onRCSteering(_ mqtt.Client, message mqtt.Message) {
err := proto.Unmarshal(message.Payload(), &evt)
if err != nil {
zap.S().Debugf("unable to unmarshal rc event: %v", err)
}else {
} else {
zap.S().Debugf("receive steering message from radio command: %0.00f", evt.GetSteering())
}
}
@ -90,7 +89,7 @@ func (p *SteeringPart) onTFSteering(_ mqtt.Client, message mqtt.Message) {
err := proto.Unmarshal(message.Payload(), &evt)
if err != nil {
zap.S().Debugf("unable to unmarshal tensorflow event: %v", err)
}else {
} else {
zap.S().Debugf("receive steering message from tensorflow: %0.00f", evt.GetSteering())
}
}

View File

@ -34,7 +34,7 @@ func TestDefaultSteering(t *testing.T) {
rcSteeringTopic := "topic/rcSteering"
tfSteeringTopic := "topic/tfSteering"
p := NewPart(nil, steeringTopic, driveModeTopic, rcSteeringTopic, tfSteeringTopic)
p := NewPart(nil, steeringTopic, driveModeTopic, rcSteeringTopic, tfSteeringTopic, true)
cases := []struct {
driveMode events.DriveModeMessage