Does node.js have anything like __file__ and __line__ like the c++ preprocessor macros?

后端 未结 4 696
日久生厌
日久生厌 2021-01-11 15:35

I\'m working on enhancing logging in some node.js applications. In the past have used C++\'s __ file__ and __ line __ preprocessor macros to help us track down issues when

4条回答
  •  迷失自我
    2021-01-11 16:28

    Just use the C preprocesor, adds an extra build step to your code but then it allows stripping out your logging for production code.

提交回复
热议问题