From d3cc24c43b7ff148d5226bba839c39afeb9b7151 Mon Sep 17 00:00:00 2001 From: shanmite Date: Mon, 25 May 2026 14:11:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20debug=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/net/bili.js | 8 ++++---- lib/utils.js | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/net/bili.js b/lib/net/bili.js index 7b7e7cf..c4bbea2 100644 --- a/lib/net/bili.js +++ b/lib/net/bili.js @@ -98,8 +98,8 @@ function get({ url, config, contents, query }) { }, query, contents, - success: res => resolve(res.body), - failure: err => resolve(err) + success: res => resolve(log.debug_return(url, res.body)), + failure: err => resolve(log.debug_return(url, err)) }); }); } @@ -122,8 +122,8 @@ function post({ url, config, contents, query }) { }, query, contents, - success: res => resolve(res.body), - failure: err => resolve(err) + success: res => resolve(log.debug_return(url, res.body)), + failure: err => resolve(log.debug_return(url, err)) }); }); } diff --git a/lib/utils.js b/lib/utils.js index 6fc2b36..be19fad 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -242,6 +242,10 @@ const utils = { this.proPrint(color_text_pair.map(([color, text]) => color(text))); } }, + debug_return(context, obj) { + this.debug(context, obj); + return obj; + }, info(context, msg) { if (this._level >= 3) { let color_text_pair = [ @@ -555,4 +559,4 @@ const utils = { }; -module.exports = utils; \ No newline at end of file +module.exports = utils;