Skip to content

Commit

Permalink
Merge pull request #475 from hahattan/issue-469
Browse files Browse the repository at this point in the history
Avoid logging CBOR event/reading
  • Loading branch information
cloudxxx8 authored Apr 9, 2020
2 parents b92b1a4 + c63d396 commit 6d36f33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/autoevent/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ func (e *executor) Run(ctx context.Context, wg *sync.WaitGroup) {
continue
}
}
common.LoggingClient.Debug(fmt.Sprintf("AutoEvent - pushing event %s", evt.String()))
if evt.HasBinaryValue() {
common.LoggingClient.Debug("AutoEvent - pushing CBOR event")
} else {
common.LoggingClient.Debug(fmt.Sprintf("AutoEvent - pushing event %s", evt.String()))
}
event := &dsModels.Event{Event: evt.Event}
// Attach origin timestamp for events if none yet specified
if event.Origin == 0 {
Expand Down
6 changes: 5 additions & 1 deletion internal/handler/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ func cvsToEvent(device *contract.Device, cvs []*dsModels.CommandValue, cmd strin
reading := common.CommandValueToReading(cv, device.Name, dr.Properties.Value.FloatEncoding)
readings = append(readings, *reading)

common.LoggingClient.Debug(fmt.Sprintf("Handler - execReadCmd: device: %s DeviceResource: %v reading: %v", device.Name, cv.DeviceResourceName, reading))
if cv.Type == dsModels.Binary {
common.LoggingClient.Debug(fmt.Sprintf("Handler - execReadCmd: device: %s DeviceResource: %v reading: binary value", device.Name, cv.DeviceResourceName))
} else {
common.LoggingClient.Debug(fmt.Sprintf("Handler - execReadCmd: device: %s DeviceResource: %v reading: %v", device.Name, cv.DeviceResourceName, reading))
}
}

if !transformsOK {
Expand Down

0 comments on commit 6d36f33

Please sign in to comment.