From 8fa862d59c26e0a3587970f598bb63349775c3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Mon, 13 Jan 2025 16:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/utils/util.logger.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/src/utils/util.logger.js b/packages/core/src/utils/util.logger.js index 8853e2e..60697aa 100644 --- a/packages/core/src/utils/util.logger.js +++ b/packages/core/src/utils/util.logger.js @@ -58,6 +58,13 @@ function log4jsConfigure (categories) { module.exports = { getLogger (category) { + if (!category) { + if (log) { + log.error('未指定日志类型,无法配置并获取日志对象!!!') + } + throw new Error('未指定日志类型,无法配置并获取日志对象!!!') + } + if (category === 'core' || category === 'gui') { // core 和 gui 的日志配置,因为它们在同一进程中,所以一起配置,且只能配置一次 if (log == null) {