strapi/packages/utils/logger/lib/default-configuration.js

17 lines
455 B
JavaScript
Raw Normal View History

'use strict';
2021-06-22 17:13:11 +02:00
const { transports, format } = require('winston');
const { LEVEL, LEVEL_LABEL, LEVELS } = require('./constants');
const { prettyPrint } = require('./formats');
const createDefaultConfiguration = () => {
return {
level: LEVEL,
levels: LEVELS,
2021-06-22 17:13:11 +02:00
format: format.errors({ stack: true }),
transports: [new transports.Console({ level: LEVEL_LABEL, format: prettyPrint() })],
};
};
module.exports = createDefaultConfiguration;