mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: winston breaks cocumberjs
This commit is contained in:
parent
690e7a68ec
commit
badf303396
1 changed files with 38 additions and 35 deletions
|
|
@ -5,39 +5,42 @@ import 'winston-daily-rotate-file';
|
|||
|
||||
export * from './wiki-output';
|
||||
|
||||
const logger = winston.createLogger({
|
||||
levels: {
|
||||
emerg: 0,
|
||||
alert: 1,
|
||||
crit: 2,
|
||||
error: 3,
|
||||
warning: 4,
|
||||
warn: 5,
|
||||
notice: 6,
|
||||
info: 7,
|
||||
debug: 8,
|
||||
},
|
||||
transports: [
|
||||
new winston.transports.Console(),
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: 'TiddlyGit-%DATE%.log',
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
zippedArchive: false,
|
||||
maxSize: '20mb',
|
||||
maxFiles: '14d',
|
||||
dirname: LOG_FOLDER,
|
||||
}),
|
||||
new RendererTransport(),
|
||||
],
|
||||
exceptionHandlers: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: 'TiddlyGit-Exception-%DATE%.log',
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
zippedArchive: false,
|
||||
maxSize: '20mb',
|
||||
maxFiles: '14d',
|
||||
dirname: LOG_FOLDER,
|
||||
}),
|
||||
],
|
||||
});
|
||||
const logger =
|
||||
process.env.NODE_ENV === 'test'
|
||||
? console
|
||||
: winston.createLogger({
|
||||
levels: {
|
||||
emerg: 0,
|
||||
alert: 1,
|
||||
crit: 2,
|
||||
error: 3,
|
||||
warning: 4,
|
||||
warn: 5,
|
||||
notice: 6,
|
||||
info: 7,
|
||||
debug: 8,
|
||||
},
|
||||
transports: [
|
||||
new winston.transports.Console(),
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: 'TiddlyGit-%DATE%.log',
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
zippedArchive: false,
|
||||
maxSize: '20mb',
|
||||
maxFiles: '14d',
|
||||
dirname: LOG_FOLDER,
|
||||
}),
|
||||
new RendererTransport(),
|
||||
],
|
||||
exceptionHandlers: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: 'TiddlyGit-Exception-%DATE%.log',
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
zippedArchive: false,
|
||||
maxSize: '20mb',
|
||||
maxFiles: '14d',
|
||||
dirname: LOG_FOLDER,
|
||||
}),
|
||||
],
|
||||
});
|
||||
export { logger };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue