Logging: Add some error output
This commit is contained in:
parent
a364ae174e
commit
9b2fc18775
|
@ -89,6 +89,7 @@ func doSetCur(w http.ResponseWriter, r *http.Request) {
|
|||
if !found {
|
||||
w.WriteHeader(404)
|
||||
fmt.Fprintf(w, "Target %s not found", tgt)
|
||||
log.Printf("setcur: target %s not configured", tgt)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,6 +165,10 @@ func doSwitch(dir bool, tgt string, w http.ResponseWriter) {
|
|||
}
|
||||
if len(errs) > 0 {
|
||||
w.WriteHeader(503)
|
||||
log.Printf("Switch resulted in %d errors:", len(errs))
|
||||
for i, e := range errs {
|
||||
log.Printf("[%d/%d]: %s", i, len(errs), e)
|
||||
}
|
||||
}
|
||||
for _, o := range res {
|
||||
fmt.Fprint(w, o)
|
||||
|
|
Loading…
Reference in New Issue