From: qydysky Date: Tue, 31 Oct 2023 17:12:35 +0000 (+0800) Subject: Improve web服务日志 X-Git-Tag: v0.11.3~4 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=bd9492d9ceab01434698e1b91c30b2e017038c67;p=bili_danmu%2F.git Improve web服务日志 --- diff --git a/Reply/F.go b/Reply/F.go index c4c5e35..7b37d43 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -1482,7 +1482,10 @@ func init() { // w.Header().Add(`Content-Range`, fmt.Sprintf("bytes %d-%d/%d", rangeHeaderNum, fi.Size()-1, fi.Size())) // w.WriteHeader(http.StatusPartialContent) - flog.L(`T: `, r.RemoteAddr, `接入录播`+v) + flog.L(`T: `, r.RemoteAddr, `接入录播`) + ts := time.Now() + defer func() { flog.L(`T: `, r.RemoteAddr, `断开录播`, time.Since(ts)) }() + if e := f.CopyToIoWriter(pweb.WithFlush(w), pio.CopyConfig{BytePerSec: speed}); e != nil { flog.L(`E: `, e) } @@ -1513,11 +1516,11 @@ func init() { // 推送数据 { startFunc := func(_ *M4SStream) error { - flog.L(`T: `, r.RemoteAddr, `接入直播流`) + flog.L(`T: `, r.RemoteAddr, `接入直播`) return nil } stopFunc := func(_ *M4SStream) error { - flog.L(`T: `, r.RemoteAddr, `断开直播流`) + flog.L(`T: `, r.RemoteAddr, `断开直播`) return nil }