mirror of https://bitbucket.org/ausocean/av.git
Change prints to use logger
This commit is contained in:
parent
fc3b835344
commit
bd9ff08c12
|
@ -337,7 +337,7 @@ func (r *revidInst)sendClipToHTTP(clip []byte, output string) error {
|
|||
Timeout: timeout,
|
||||
}
|
||||
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
|
||||
if err != nil {
|
||||
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()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err == nil {
|
||||
fmt.Printf("%s\n", body)
|
||||
r.ErrOut(fmt.Sprintf("%s\n", body))
|
||||
} else {
|
||||
r.ErrOut(err.Error())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue