mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🔊 调试模式下的log不输出到文件
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
/**
|
||||
* @file utils/TGLogger.ts
|
||||
* @description 日志工具
|
||||
* @since Beta v0.4.2
|
||||
* @since Beta v0.4.4
|
||||
*/
|
||||
|
||||
import { info, warn, error } from "tauri-plugin-log-api";
|
||||
import { info, warn, error, attachConsole } from "tauri-plugin-log-api";
|
||||
|
||||
/**
|
||||
* @description 日志工具
|
||||
* @since Beta v0.4.2
|
||||
* @since Beta v0.4.4
|
||||
*/
|
||||
class TGLogger {
|
||||
constructor() {
|
||||
if (import.meta.env.MODE === "development") {
|
||||
void attachConsole().then(() => {
|
||||
console.log("Console attached");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 输出日志-信息
|
||||
* @since Beta v0.4.2
|
||||
|
||||
Reference in New Issue
Block a user