style(offline_download): add more description in log (#653)

fix(offline_download): add more description in log
This commit is contained in:
MadDogOwner
2025-07-09 14:16:05 +08:00
committed by GitHub
parent 3838ef0663
commit 7c7cec0993
2 changed files with 4 additions and 4 deletions

View File

@ -9,9 +9,9 @@ func InitOfflineDownloadTools() {
for k, v := range tool.Tools { for k, v := range tool.Tools {
res, err := v.Init() res, err := v.Init()
if err != nil { if err != nil {
utils.Log.Warnf("init tool %s failed: %s", k, err) utils.Log.Warnf("init offline download tool %s failed: %s", k, err)
} else { } else {
utils.Log.Infof("init tool %s success: %s", k, res) utils.Log.Infof("init offline download tool %s success: %s", k, res)
} }
} }
} }

View File

@ -72,13 +72,13 @@ func AddURL(ctx context.Context, args *AddURLArgs) (task.TaskExtensionInfo, erro
// get tool // get tool
tool, err := Tools.Get(args.Tool) tool, err := Tools.Get(args.Tool)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "failed get tool") return nil, errors.Wrapf(err, "failed get offline download tool")
} }
// check tool is ready // check tool is ready
if !tool.IsReady() { if !tool.IsReady() {
// try to init tool // try to init tool
if _, err := tool.Init(); err != nil { if _, err := tool.Init(); err != nil {
return nil, errors.Wrapf(err, "failed init tool %s", args.Tool) return nil, errors.Wrapf(err, "failed init offline download tool %s", args.Tool)
} }
} }