Skip to content

Commit

Permalink
added request object dumping when debug enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bodokaiser committed Aug 4, 2018
1 parent 0d60414 commit 6aa2564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func main() {
Devices: cmd.Devices,
DDS: ad9910.NewAD9910(cmd.DDS.Config),
Mux: mux.NewDigital(cmd.Mux),
Debug: cmd.DDS.Config.Debug,
}

if err := h.DDS.Init(); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions httpd/handler/dds_devices.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handler

import (
"log"
"net/http"
"time"

Expand All @@ -21,6 +22,7 @@ type DDSDevices struct {
Devices model.DDSDevices
Mux mux.Mux
DDS dds.DDS
Debug bool
}

// List handles responds a list of available devices.
Expand Down Expand Up @@ -50,6 +52,10 @@ func (h *DDSDevices) Update(ctx echo.Context) error {
return err
}

if h.Debug {
log.Printf("%+v\n", d)
}

if err := d.Validate(); err != nil {
return err
}
Expand Down

0 comments on commit 6aa2564

Please sign in to comment.