You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider using pino instead of winston for logging #709
It could be a better option, not only because of asthetics, but also because of functionality and apparent project health. Configured logger objects can be passed as suggested on pinojs/pino#1108 (comment).
constpino=require('pino');constwinston=require('winston');constpinoLogger=pino({prettyPrint: {ignore: 'pid,hostname',translateTime: true,colorize: true},level: 'debug'},process.stderr);constwinstonLogger=winston.createLogger({level: 'debug',format: winston.format.combine(winston.format.colorize(),winston.format.timestamp({format: 'YYYY-MM-DD HH:mm:ss.SSS ZZ'}),winston.format.simple()),transports: [newwinston.transports.Console({stderrLevels: Object.keys(winston.config.npm.levels)})]});for(loggerof[pinoLogger,winstonLogger]){logger.error(newError('runners are exhausted because of cloud altitude'));logger.warn('the personal access token has been written backwards');logger.info('no bot dared to comment on your last commit');logger.debug('this repository contains files');}
Activity
0x2b3bfa0 commentedon Sep 10, 2021
Try–it–yourself comparison
Pino
Winston
DavidGOrtega commentedon Sep 17, 2021
I do not understand what do you want to showcase with this example. Whats the main difference?
0x2b3bfa0 commentedon Sep 23, 2021
dacbd commentedon Oct 31, 2022
p3-cool-if-someone-is-really-bored-on-a-weekendorp4-graveyard?0x2b3bfa0 commentedon Oct 31, 2022
p5-low-priority-enough-to-postpone-choosing-a-priority