Why this matters
Accelerates debugging and enables reliable alerting.
Log failures with operation name, key identifiers, and exception; prefer structured logging (fields).
Accelerates debugging and enables reliable alerting.
Side-by-side examples engineers can pattern-match during review.
println(e)logger.error("payment_failed", mapOf("orderId" to orderId, "userId" to userId, "err" to e))e.printStackTrace()logger.error("op_failed", mapOf("op" to op, "err" to e))From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.