summaryrefslogtreecommitdiff
path: root/bilibili/streaming.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-10 18:28:19 +0800
committerKeuin <[email protected]>2022-09-10 18:28:19 +0800
commit73b2b41e777614d7c372b9d92a90b5fbb68d05c0 (patch)
tree39bf028dbe68347444dc25abdfd29d1cad7d2989 /bilibili/streaming.go
parent5664705557ad5e4a3bd1234b12e4054a1a9579c1 (diff)
Replace all logger usages to custom logging.Logger.
Diffstat (limited to 'bilibili/streaming.go')
-rw-r--r--bilibili/streaming.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/bilibili/streaming.go b/bilibili/streaming.go
index 9a26c2d..7ad852c 100644
--- a/bilibili/streaming.go
+++ b/bilibili/streaming.go
@@ -27,7 +27,7 @@ func (b Bilibili) CopyLiveStream(
r, err := b.newGet(url)
if err != nil {
- b.error.Printf("Cannot create HTTP GET instance on %v: %v", url, err)
+ b.logger.Error("Cannot create HTTP GET instance on %v: %v", url, err)
return err
}
@@ -36,7 +36,7 @@ func (b Bilibili) CopyLiveStream(
resp, err := b.Do(r)
if err != nil {
- b.error.Printf("Cannot make HTTP GET request on %v: %v\n", url, err)
+ b.logger.Error("Cannot make HTTP GET request on %v: %v\n", url, err)
return
}
@@ -56,13 +56,13 @@ func (b Bilibili) CopyLiveStream(
n, err := common.CopyToFileWithBuffer(ctx, out, resp.Body, buffer, readChunkSize, false)
if err != nil && !errors.Is(err, context.Canceled) {
- b.error.Printf("Stream copying was interrupted unexpectedly: %v", err)
+ b.logger.Error("Stream copying was interrupted unexpectedly: %v", err)
}
if err == nil {
- b.info.Printf("The live is ended. (room %v)", roomId)
+ b.logger.Info("The live is ended. (room %v)", roomId)
}
- b.info.Printf("Total downloaded: %v", common.PrettyBytes(uint64(n)))
+ b.logger.Info("Total downloaded: %v", common.PrettyBytes(uint64(n)))
return err
}