Skip to content

Instantly share code, notes, and snippets.

@ianaya89

ianaya89/logger.js

Created Dec 5, 2019
Embed
What would you like to do?
'use strict'
const chalk = require('chalk')
const winston = require('winston')
const { difference } = require('lodash')
const { format } = require('logform')
const loggerConfig = {} // TODO: Add config
return winston.createLogger({
transports: [],
format: format.combine(
format.splat(),
format.colorize(),
format.timestamp(),
format.align(),
format.printf(
info =>
`${chalk.gray(info.timestamp)} ${info.level}[${chalk.blueBright(
context
)}] ${info.message}`
)
)
})
module.exports = logger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment