2025-02-25 11:57:54 +08:00
|
|
|
import log from "electron-log";
|
|
|
|
|
|
|
|
class Logger {
|
|
|
|
static {
|
|
|
|
log.transports.file.level = "debug";
|
|
|
|
log.transports.console.level = "debug";
|
|
|
|
}
|
|
|
|
|
2025-02-25 12:32:48 +08:00
|
|
|
public static info(module: string, msg: string) {
|
|
|
|
log.info(`[${module}] ${msg}`);
|
|
|
|
}
|
2025-02-25 11:57:54 +08:00
|
|
|
|
2025-02-25 12:32:48 +08:00
|
|
|
public static debug(module: string, msg: string) {
|
|
|
|
log.debug(`[${module}] ${msg}`);
|
|
|
|
}
|
2025-02-25 11:57:54 +08:00
|
|
|
|
2025-02-25 12:32:48 +08:00
|
|
|
public static warn(module: string, msg: string) {
|
|
|
|
log.warn(`[${module}] ${msg}`);
|
|
|
|
}
|
2025-02-25 11:57:54 +08:00
|
|
|
|
2025-02-25 12:32:48 +08:00
|
|
|
public static error(module: string, msg: string) {
|
|
|
|
log.warn(`[${module}] ${msg}`);
|
|
|
|
}
|
2025-02-25 11:57:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Logger;
|