Change prints to use logger

This commit is contained in:
Unknown 2018-01-23 20:17:13 +10:30
parent fc3b835344
commit bd9ff08c12
1 changed files with 2 additions and 2 deletions

View File

@ -337,7 +337,7 @@ func (r *revidInst)sendClipToHTTP(clip []byte, output string) error {
Timeout: timeout, Timeout: timeout,
} }
url := output + strconv.Itoa(len(clip)) url := output + strconv.Itoa(len(clip))
fmt.Printf("Posting %s (%d bytes)\n", url, len(clip)) r.ErrOut(fmt.Sprintf("Posting %s (%d bytes)\n", url, len(clip)))
resp, err := client.Post(url, "video/mp2t", bytes.NewReader(clip)) // lighter than NewBuffer resp, err := client.Post(url, "video/mp2t", bytes.NewReader(clip)) // lighter than NewBuffer
if err != nil { if err != nil {
return fmt.Errorf("Error posting to %s: %s", output, err) return fmt.Errorf("Error posting to %s: %s", output, err)
@ -345,7 +345,7 @@ func (r *revidInst)sendClipToHTTP(clip []byte, output string) error {
defer resp.Body.Close() defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) body, err := ioutil.ReadAll(resp.Body)
if err == nil { if err == nil {
fmt.Printf("%s\n", body) r.ErrOut(fmt.Sprintf("%s\n", body))
} else { } else {
r.ErrOut(err.Error()) r.ErrOut(err.Error())
} }