Jelajahi Sumber

日志优化

skyfffire 2 tahun lalu
induk
melakukan
b9c6cea9e3
1 mengubah file dengan 5 tambahan dan 4 penghapusan
  1. 5 4
      scripts/one-pro.js

+ 5 - 4
scripts/one-pro.js

@@ -46,11 +46,12 @@ const holdingHandler = async function(context, task, token, pair) {
       // 交易数据持久化
       await token.save()
 
-      fileLogger.info(`[${isTimeOverStop ? '时' : '强'}${isStopWin ? '盈+' : '损-'}]${pair}, `
-        .concat(`成交额${cummulativeQuoteQty}, 均价${orderPrice}->${price}, 卖出${orderAmount}个.`)
-      )
+      const log = `[${isTimeOverStop ? '时' : '强'}${isStopWin ? '盈+' : '损-'}]${pair}, `
+        + `成交额${cummulativeQuoteQty}, 均价${orderPrice}->${price}, 卖出${orderAmount}个.`
+      fileLogger.info(log)
     } catch (e) {
-      fileLogger.error(`[${isTimeOverStop ? '时' : '强'}止${isStopWin ? '盈' : '损'}失败]${pair}, ${e}`)
+      const log = `[${isTimeOverStop ? '时' : '强'}止${isStopWin ? '盈' : '损'}失败]${pair}, ${e}`
+      fileLogger.error(log)
     }
   }
 }