3 ms·
> Log after, not before I'd say this is good for production. During development, I sometimes like to log the name of the function I'm in as the first line of
by comeonseriously 5y ago
> Log after, not before
I'd say this is good for production. During development, I sometimes like to log the name of the function I'm in as the first line of the function. That way I'm assured to know if the function was even called. I will also put before and after logs if I want to see how data is changed (Yeah, there are things called debuggers that let you watch variables, but sometimes a log is just so much easier - such as in heavily threaded code or code with a number of timers and events firing).
- raldi 5y agoThat's why the author wrote: > I make exceptions for DEBUG.
- jonnycomputer 5y agoYes, but I think the author could have expanded on that tbh.
- 8008135 5y agoBut that makes me engage my monkey brain to decide what level and where to put the message. Easier to have a consistent rule that all logging is before/after (I'm strongly in the before camp).