2023-01-24 10:59:45 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const { transports } = require('winston');
|
|
|
|
const { LEVEL_LABEL, LEVELS } = require('../constants');
|
|
|
|
const { prettyPrint } = require('../formats');
|
2023-01-24 11:11:26 +01:00
|
|
|
const { excludeColors } = require('../formats');
|
2023-01-24 10:59:45 +01:00
|
|
|
|
|
|
|
const createOutputFileConfiguration = (filename) => {
|
|
|
|
return {
|
|
|
|
level: LEVEL_LABEL,
|
|
|
|
levels: LEVELS,
|
|
|
|
format: prettyPrint(),
|
|
|
|
transports: [
|
|
|
|
new transports.Console(),
|
|
|
|
new transports.File({ level: 'error', filename, format: excludeColors }),
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = createOutputFileConfiguration;
|