Created
February 3, 2016 19:44
-
-
Save Charlyzzz/b952ab85a91b1a565538 to your computer and use it in GitHub Desktop.
Winston
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
/** | |
* Created by erwincdl on 03/02/16. | |
*/ | |
var winston = require('winston'); | |
var getTimestamp = () => { | |
return Date.now(); | |
}; | |
var logger = new winston.Logger({ | |
level: 'silly', | |
transports: [ | |
new (winston.transports.Console)({ | |
timestamp: getTimestamp | |
}) | |
] | |
}); | |
logger.log('silly', "127.0.0.1 - there's no place like home"); | |
logger.log('debug', "127.0.0.1 - there's no place like home"); | |
logger.log('verbose', "127.0.0.1 - there's no place like home"); | |
logger.log('info', "127.0.0.1 - there's no place like home"); | |
logger.log('warn', "127.0.0.1 - there's no place like home"); | |
logger.log('error', "127.0.0.1 - there's no place like home"); | |
logger.info("127.0.0.1 - there's no place like home"); | |
logger.warn("127.0.0.1 - there's no place like home"); | |
logger.error("127.0.0.1 - there's no place like home"); | |
/** | |
*1454528607157 - silly: 127.0.0.1 - there's no place like home | |
*1454528607162 - debug: 127.0.0.1 - there's no place like home (Coloreado) | |
*1454528607165 - error: 127.0.0.1 - there's no place like home (Coloreado) | |
*1454528607166 - error: 127.0.0.1 - there's no place like home (Coloreado) | |
*1454528607165 - verbose: 127.0.0.1 - there's no place like home | |
*1454528607165 - info: 127.0.0.1 - there's no place like home | |
*1454528607165 - warn: 127.0.0.1 - there's no place like home | |
*1454528607166 - info: 127.0.0.1 - there's no place like home | |
*1454528607166 - warn: 127.0.0.1 - there's no place like home | |
* | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment