forked from DebaucheryLibrarian/traxxx
Accounting for Windows paths in logger.
This commit is contained in:
@@ -9,7 +9,7 @@ require('winston-daily-rotate-file');
|
||||
const args = require('./argv');
|
||||
|
||||
function logger(filepath) {
|
||||
const root = filepath.match(/src\/|dist\//);
|
||||
const root = filepath.match(/src[/\\]|dist[/\\]/);
|
||||
const filename = filepath.slice(root.index + root[0].length)
|
||||
.replace(path.extname(filepath), '');
|
||||
|
||||
@@ -29,7 +29,7 @@ function logger(filepath) {
|
||||
}),
|
||||
new winston.transports.DailyRotateFile({
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
filename: 'log/%DATE%.log',
|
||||
filename: path.join('log', '%DATE%.log'),
|
||||
level: 'silly',
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user