Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 31, 2021 06:30 am GMT

Good Bye console.log,no console.log in 2022

yes you heard it right.

we frequently use console.log() to check our outputs in console, it's ok in Development mode but it is highly disgraced in production.

so then what's the solution for it.so in production we basically use production grade loggers.This article is going to teach you how to use ps-logger.

Q.Why ps-logger ?
=>yes you have few other options but the problem is that you have to do lots of manual configurations in it.That's why beginners don't even touch production grade loggers.

ps-logger is a plug and play logger.There is no manual configurations.you have to just install and use it.

npm i ps-logger
  • Example:-
const logger=require('ps-logger');logger.info("This is info")logger.warn("This is warning");logger.error("This is error");logger.debug("This is debug");logger.prompt("This is prompt");logger.verbose("This is verbose");logger.silly("This is silly");

ps-logger

  • if you want to disable its colors
logger.setColor(false);

in future updates it will provide more features to you guys


Original Link: https://dev.to/imshivanshpatel/good-bye-consolelogno-consolelog-in-2022-1foc

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To