3 ms·
I completely disagree with Thomas' first point. It is better IMO to always log before you do something so that if you crash during whatever was happening, you k
by slaymaker1907 5y ago
I completely disagree with Thomas' first point. It is better IMO to always log before you do something so that if you crash during whatever was happening, you know what you were trying to do. Additionally, if you have enough logging, you can figure out that some call did succeed by implication so long as you have access to the source code/know what the order of high level operations are.
If for some reason you can't easily figure out whether something succeeded, you should probably log before and after the operation. I personally try to avoid doing this since it can clutter up the log, but it can be useful depending on how code is structured.
Another minor point is that I prefer to have INFO cram as much information as possible with DEBUG reserved for stuff which is ignored unless you explicitly turn it on either due to lack of utility vs cost.