Purposeful crash context
There are situations where you want to crash on purpose. Some code path was taken that should never be possible. Critical configuration or a key asset is missing. You want this to be known then and there: something really bad was already determined, and further execution could lead to vague failures that aren’t the root cause.
Often projects will have a custom assert system in place, where you can specify a custom message to be logged (these should not be optional), and will automatically include the code filename, line of code, call stack, version information, and more. Since it’s a crash, it will go into the crash reporting pipeline to notify developers and be triaged for examination.
It’s useful to review your error reporting practices: are you providing as much context as possible, as automatically as possible? Or are your logs filled with cryptic messages that require further investigation just to make sense of them?