Simplified tag media seed file. Renamed tags. Media refactor experiment.
This commit is contained in:
25
src/logger.js
Normal file
25
src/logger.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const util = require('util');
|
||||
const winston = require('winston');
|
||||
const args = require('./argv');
|
||||
|
||||
const logger = winston.createLogger({
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp(),
|
||||
winston.format.printf(info => `${info.timestamp} ${info.level}: ${util.inspect(info.message)}`),
|
||||
),
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
level: args.level,
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
|
||||
winston.format.colorize(),
|
||||
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`),
|
||||
),
|
||||
timestamp: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
module.exports = logger;
|
||||
Reference in New Issue
Block a user