Fixes 251. Set debug_write to false by default. Added log output of byte count when debug is false. Updated tests to match new default

Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
This commit is contained in:
Burton Rheutan
2017-10-14 09:45:11 -05:00
committed by Alex Ellis
parent b308388bc2
commit b9f59f5150
3 changed files with 21 additions and 17 deletions

View File

@ -145,6 +145,8 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
if config.writeDebug == true {
log.Printf("Success=%t, Error=%s\n", targetCmd.ProcessState.Success(), err.Error())
log.Printf("Out=%s\n", out)
} else {
log.Printf("An Error Occurred\n")
}
if ri.headerWritten == false {
@ -162,6 +164,8 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
if config.writeDebug == true {
os.Stdout.Write(out)
} else {
log.Printf("Wrote %d Bytes\n", len(out))
}
if len(config.contentType) > 0 {