Created
December 5, 2019 21:04
-
-
Save ianaya89/b8598bf7df7558662ae18d109d9f4d49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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