From 73b2b41e777614d7c372b9d92a90b5fbb68d05c0 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 10 Sep 2022 18:28:19 +0800 Subject: Replace all logger usages to custom logging.Logger. --- bilibili/streaming.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bilibili/streaming.go') 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 } -- cgit v1.2.3