console-ninja icon indicating copy to clipboard operation
console-ninja copied to clipboard

Other loggers than console

Open fearless23 opened this issue 2 years ago • 5 comments

Can console-nija support other loggers like pino. I don`t want to litter my project with console.log calls which is not recommended for production. Can it support other methods in near future.

fearless23 avatar Dec 10 '22 17:12 fearless23

I don`t want to litter my project with console.log calls which is not recommended for production.

The idea of Console Ninja is to enhance console.log for dev mode. Ie. you may add console.log when exploring some code or debugging an issue, or adding a feature, and Console Ninja can show you the results. Then you remove console.log calls before committing to source control.

ArtemGovorov avatar Dec 11 '22 01:12 ArtemGovorov

In order to help keep ourselves hygienic during such exploration, we have two simple wrapper functions, devLog() and prodLog() to make intentions explicit. However, that practice basically makes Console Ninja useless for us. In theory I could just use console.log() for dev but it feels weird to abandon a useful practice just to make a tool work.

I realize that supporting wrapper functions would be one step down the dark path of supporting logging libraries, but just wanted to highlight this use case in the hopes it helps. :)

ipsquiggle avatar Jan 16 '23 23:01 ipsquiggle

Until such time the support for custom loggers is added, logpoints may be used as a (more powerful) alternative.

ArtemGovorov avatar Sep 11 '23 00:09 ArtemGovorov

I'm also very interested in the ability to have custom loggers, pretty much for the same reason as @fearless23.

valpetvisma avatar Jan 03 '24 08:01 valpetvisma

I hope it suport PinoLogger

ImBIOS avatar Apr 17 '25 10:04 ImBIOS