Adding timestamps to all console messages

前端 未结 12 1123
鱼传尺愫
鱼传尺愫 2021-01-31 06:51

I have a complete, deployed, Express-based project, with many console.log() and console.error() statements throughout. The project runs using forever, directing the st

12条回答
  •  攒了一身酷
    2021-01-31 07:22

    You can use a function util.log from https://nodejs.org/api/util.html.

    Be aware that it was deprecated since version 6.0.0.

    For higher versions you should "Use a third party module instead."

提交回复
热议问题