feat: 项目结构调整|新增依赖
This commit is contained in:
29
src/electron/main/modules/logger/index.ts
Normal file
29
src/electron/main/modules/logger/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as log4js from 'log4js';
|
||||
|
||||
log4js.configure({
|
||||
appenders: {
|
||||
out: {
|
||||
type: 'stdout'
|
||||
},
|
||||
app: {
|
||||
type: 'file',
|
||||
filename: 'logs/app.log',
|
||||
backups: 3,
|
||||
compress: false,
|
||||
encoding: 'utf-8',
|
||||
layout: {
|
||||
type: 'pattern',
|
||||
pattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] [%p] %m'
|
||||
},
|
||||
keepFileExt: true
|
||||
}
|
||||
},
|
||||
categories: {
|
||||
default: {
|
||||
appenders: ['out', 'app'],
|
||||
level: 'debug'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export const logger = log4js.getLogger();
|
||||
Reference in New Issue
Block a user