mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
16 lines
507 B
JavaScript
16 lines
507 B
JavaScript
const { createLogger, transports, format } = require('winston')
|
|
|
|
const logger = createLogger({
|
|
transports: process.env.NODE_ENV !== 'production'
|
|
? [new transports.Console(
|
|
{ level: 'debug', format: format.combine(format.colorize(), format.simple(), format.errors({ stack: true })) }
|
|
)]
|
|
: [new transports.File(
|
|
{
|
|
filename: 'gancio.log',
|
|
format: format.combine(format.simple(), format.errors({ stack: true }))
|
|
}
|
|
)]
|
|
})
|
|
|
|
module.exports = logger
|