diff --git a/cmd/bisync/bilib/output.go b/cmd/bisync/bilib/output.go index ccd85c125..c35abde86 100644 --- a/cmd/bisync/bilib/output.go +++ b/cmd/bisync/bilib/output.go @@ -5,20 +5,13 @@ import ( "bytes" "log" - "github.com/rclone/rclone/fs" "github.com/sirupsen/logrus" ) // CaptureOutput runs a function capturing its output. func CaptureOutput(fun func()) []byte { logSave := log.Writer() - logrusSave := logrus.StandardLogger().Writer() - defer func() { - err := logrusSave.Close() - if err != nil { - fs.Errorf(nil, "error closing logrusSave: %v", err) - } - }() + logrusSave := logrus.StandardLogger().Out buf := &bytes.Buffer{} log.SetOutput(buf) logrus.SetOutput(buf)