3 ms·
This library's 'ad copy' focuses on its ability to print the expression passed to the `log` function verbatim, but for those thinking about importing this libra
by rzwitserloot 6y ago
This library's 'ad copy' focuses on its ability to print the expression passed to the `log` function verbatim, but for those thinking about importing this library or something like it, I find that the most useful long-term benefit of a construction like this is this:
All short-term logging / debugging calls are now properly isolated.
Ordinarily, if you spot a `print` statement in code it's usually a left-over relic of some previous debug session. Or it's the command line printer, who knows?
With a call to ic, you know it's short-term logging and nothing else. You can search for them, you can spot them immediately in commit changelogs, you can write hooks if you want to ban them from ever appearing in certain branches, you can breakpoint them in your IDE, etcetera.
For many apps, _all_ print statements work like that, but I've worked on more than a few that have a 'print to standard out' component to them.