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; }, }, {