main.go: log more to console

main
leonnicolas 3 years ago
parent 1b2e10f98e
commit c84e98e389
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -32,8 +32,10 @@ func (w *Worker) Start(ctx context.Context) ([]byte, error) {
defer w.mx.Unlock() defer w.mx.Unlock()
w.status = Running w.status = Running
defer w.SetTerminated() defer w.SetTerminated()
log.Println("call: ", *command, (*args))
o, err := exec.CommandContext(ctx, *command, *args...).Output() o, err := exec.CommandContext(ctx, *command, *args...).Output()
if err != nil { if err != nil {
log.Println(err)
return nil, err return nil, err
} }
return o, nil return o, nil
@ -79,5 +81,5 @@ func main() {
w.Write([]byte(worker.Status())) w.Write([]byte(worker.Status()))
return return
}) })
http.ListenAndServe(":8080", mux) log.Fatal(http.ListenAndServe(":8080", mux))
} }

Loading…
Cancel
Save