[BC Break][Debug] #2042 implementation of fatal error logging

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #2042
| License       | MIT
| Doc PR        | -