You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f2094e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(logging): add registerable FatalHandler before abort (#725 review ⑤)
Address the extensibility comment: let an embedder (JNI, Python host, crash
reporter) run a hook on the fatal path before std::abort() to flush resources or
print a stack trace.
- Add FatalHandler = std::function<void(const std::source_location&,
std::string_view)> plus thread-safe SetFatalHandler/GetFatalHandler (leaked,
teardown-safe slot in logger.cc).
- Wire it into LogFatal: format the message once, emit-if-enabled + flush, run the
handler (message passed even when the record is filtered out), then abort. A
throwing handler cannot prevent the abort.
- Death tests: handler runs with the formatted message, receives the call-site
location, and still fires when the record is suppressed.
Co-authored-by: Isaac
0 commit comments