by mekster · 6y ago · 0 comments
I think literally every logger let's you log at a certain point as a single line that does not cover the context of the log.
logger.info('Doing this and that', function () {
do_this()
if(maybe) do_that()
})
This way you know how much the log comment is supposed to cover as well as take a benchmark on the said context.I can never think to just add a single line logger anymore.
This is much better than inserting comments in a code as comments can have no context except the line below.
You can add a function like,
logger.comment
and don't let it log anything to be comment syntax replacement.
You can certainly add a comment on how you don't like it.