瀏覽代碼

enhance(plugin): better log for beforeunload hook on user side

charlie 2 年之前
父節點
當前提交
2eaa1162e1
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      libs/src/LSPlugin.core.ts
  2. 1 1
      libs/src/LSPlugin.user.ts

+ 1 - 1
libs/src/LSPlugin.core.ts

@@ -924,7 +924,7 @@ class PluginLocal extends EventEmitter<
           )
           this.emit('beforeunload', eventBeforeUnload)
         } catch (e) {
-          this.logger.error('[beforeunload Error]', e)
+          this.logger.error('[beforeunload]', e)
         }
 
         await this.dispose()

+ 1 - 1
libs/src/LSPlugin.user.ts

@@ -513,7 +513,7 @@ export class LSPluginUser
         cb && (await cb(rest))
         actor?.resolve(null)
       } catch (e) {
-        console.debug(`${_caller.debugTag} [beforeunload] `, e)
+        this.logger.error(`[beforeunload] `, e)
         actor?.reject(e)
       }
     })