Skip to content

Commit

Permalink
Add debug logs for run RTSP pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 21, 2024
1 parent 99cc21a commit a518488
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/md5"
"encoding/hex"
"errors"
"fmt"
"io"
"net/url"
"os"
Expand Down Expand Up @@ -90,6 +89,10 @@ func handlePipe(_ string, cmd *exec.Cmd, query url.Values) (core.Producer, error
return nil, err
}

log.Debug().Strs("args", cmd.Args).Msg("[exec] run pipe")

ts := time.Now()

if err = cmd.Start(); err != nil {
return nil, err
}
Expand All @@ -99,6 +102,8 @@ func handlePipe(_ string, cmd *exec.Cmd, query url.Values) (core.Producer, error
_ = r.Close()
}

log.Debug().Stringer("launch", time.Since(ts)).Msg("[exec] run pipe")

return prod, err
}

Expand Down Expand Up @@ -127,7 +132,7 @@ func handleRTSP(url string, cmd *exec.Cmd, path string) (core.Producer, error) {
waitersMu.Unlock()
}()

log.Debug().Str("url", url).Str("cmd", fmt.Sprintf("%s", strings.Join(cmd.Args, " "))).Msg("[exec] run")
log.Debug().Strs("args", cmd.Args).Msg("[exec] run rtsp")

ts := time.Now()

Expand All @@ -150,7 +155,7 @@ func handleRTSP(url string, cmd *exec.Cmd, path string) (core.Producer, error) {
// limit message size
return nil, errors.New("exec: " + stderr.String())
case prod := <-waiter:
log.Debug().Stringer("launch", time.Since(ts)).Msg("[exec] run")
log.Debug().Stringer("launch", time.Since(ts)).Msg("[exec] run rtsp")
return prod, nil
}
}
Expand Down

0 comments on commit a518488

Please sign in to comment.