Categories
javascript

Lazy/conditional logging in JavaScript

I had some trace logs that I only wanted to enable conditionally, eg only when the logging level was set to TRACE. I couldn’t find a node.js library that enables this kind of logging. For each of them, the logger always evaluated the string input. The longRunningTask was always ran, even if trace logging was […]