From 998c9f909efc6dc7fc0ee6effd23153ae6efd493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Sat, 30 Apr 2022 14:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E8=84=9A?= =?UTF-8?q?=E6=9C=AC/=E8=AE=A2=E9=98=85=E6=A3=80=E6=9F=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=B4=E9=9A=94=E6=97=A0=E6=B3=95=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 11 +++++++++++ src/views/pages/Option/tabs/Config.vue | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/background.ts b/src/background.ts index 4ac50119..36012d72 100644 --- a/src/background.ts +++ b/src/background.ts @@ -15,6 +15,8 @@ import { UserManager } from './apps/user/manager'; import { ToolsManager } from './apps/tools/manager'; import Dexie from 'dexie'; import { DBLogger } from './apps/logger/dblogger'; +import { createLogger } from './apps/logger/logger'; +import { ConsoleTransports } from './apps/logger/console'; migrate(); @@ -24,6 +26,14 @@ InitApp({ Environment: ENV_BACKGROUND, }); +const logger = createLogger({ + catalog: { + name: 'background', + }, + level: process.env.NODE_ENV === 'development' ? 'debug' : 'info', + transports: [new ConsoleTransports()], +}); + void SystemConfig.init(); chrome.contextMenus.create({ @@ -84,6 +94,7 @@ function sandboxLoad(event: MessageEvent<{ action: string }>) { // 检查更新 setInterval(() => { + logger.debug(`check_script_update_cycle ${SystemConfig.check_script_update_cycle}`); if (SystemConfig.check_script_update_cycle === 0) { return; } diff --git a/src/views/pages/Option/tabs/Config.vue b/src/views/pages/Option/tabs/Config.vue index 879dfef1..c7a1bf4f 100644 --- a/src/views/pages/Option/tabs/Config.vue +++ b/src/views/pages/Option/tabs/Config.vue @@ -63,7 +63,7 @@ export default class Config extends Vue { { key: 604800, val: '每周' }, ], change(val: any) { - SystemConfig.check_script_update_cycle = val.value.key; + SystemConfig.check_script_update_cycle = val.value; }, }, {