From 0b980891f1481f02fde53e49a41aa7a40e13e9f2 Mon Sep 17 00:00:00 2001 From: HuanLinOTO Date: Sun, 27 Aug 2023 22:29:50 +0800 Subject: [PATCH] fix --- src/index.js | 6 +++--- src/logger.js | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 87f3e44..c013f61 100644 --- a/src/index.js +++ b/src/index.js @@ -5,9 +5,9 @@ const reggol = require("reggol") const { getConfigs, checkConfigs, makeHeader, Notification, Wallet, SendLog, AppVersion, getGlobalConfig } = require("./config") const urlconfig = require("./config") -const { log, addLogContent } = require("./logger"); +const { log, addLogContent, getLogs } = require("./logger"); -const nodemailer = require("nodemailer") +const nodemailer = require("nodemailer"); (async () => { log.info("开始获取全局配置") @@ -70,7 +70,7 @@ const nodemailer = require("nodemailer") globalConfig.mailConfig.mailto, successNum, totalNum, - logContent + getLogs() ) } })() \ No newline at end of file diff --git a/src/logger.js b/src/logger.js index 507158c..1213538 100644 --- a/src/logger.js +++ b/src/logger.js @@ -4,6 +4,10 @@ let logContent = `` exports.addLogContent = function(content) { logContent += content } +exports.getLogs = function() { + return logContent +} + exports.log = { info(content) { logContent += `[info] ${content}
`