google / glog

C++ implementation of the Google logging module
http://google.github.io/glog/
BSD 3-Clause "New" or "Revised" License
6.93k stars 2.05k forks source link

Restore "Check failure stack trace" message on LOG(FATAL) #1110

Open AustinSchuh opened 1 month ago

AustinSchuh commented 1 month ago

https://github.com/google/glog/pull/1074 refactored some of the code to enable the failure function to throw. This made it so when the LogMessageFatal class was used, the error ended up being printed differently.

Before: LOG_AT_LEVEL(google::LogSeverity::FATAL) << "Crash: Hello world!"; ->

F20240621 18:12:44.710584 139620827212672 log_demo.cc:16] Crash: Hello world! Check failure stack trace: @ 0x559e2704711a @ 0x7efc01fac24a @ 0x7efc01fac305 @ 0x559e27046dd5 Aborted

LOG(FATAL) << "Crash: Hello world!"; ->

F20240621 18:13:05.760556 140518290856832 log_demo.cc:16] Crash: Hello world! @ 0x55cdc2475130 @ 0x7fccf6fb324a @ 0x7fccf6fb3305 @ 0x55cdc2474df5 Aborted

With this patch, they both produce the same output.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.65%. Comparing base (45f99f5) to head (039298a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1110 +/- ## ========================================== + Coverage 63.57% 63.65% +0.07% ========================================== Files 20 20 Lines 2578 2578 Branches 894 907 +13 ========================================== + Hits 1639 1641 +2 Misses 671 671 + Partials 268 266 -2 ``` | [Files](https://app.codecov.io/gh/google/glog/pull/1110?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | | |---|---|---| | [src/logging.cc](https://app.codecov.io/gh/google/glog/pull/1110?src=pr&el=tree&filepath=src%2Flogging.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-c3JjL2xvZ2dpbmcuY2M=) | `70.28% <50.00%> (+0.15%)` | :arrow_up: |