Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support failure functions that throw #1074

Merged
merged 1 commit into from
Feb 17, 2024
Merged

Conversation

sergiud
Copy link
Collaborator

@sergiud sergiud commented Feb 17, 2024

Resolves #249

@sergiud sergiud added this to the 0.7 milestone Feb 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (68b6ce3) 59.60% compared to head (316d143) 59.73%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1074      +/-   ##
==========================================
+ Coverage   59.60%   59.73%   +0.13%     
==========================================
  Files          19       19              
  Lines        2604     2608       +4     
  Branches      914      919       +5     
==========================================
+ Hits         1552     1558       +6     
- Misses        712      730      +18     
+ Partials      340      320      -20     
Files Coverage Δ
src/glog/logging.h 65.71% <33.33%> (+1.42%) ⬆️
src/logging.cc 67.01% <66.66%> (+0.17%) ⬆️

... and 3 files with indirect coverage changes

@sergiud sergiud merged commit b24e4d9 into master Feb 17, 2024
400 checks passed
@sergiud sergiud deleted the throw-failure-function branch February 17, 2024 17:41
AustinSchuh added a commit to AustinSchuh/glog that referenced this pull request Jun 22, 2024
google#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.

Signed-off-by: Austin Schuh <[email protected]>
AustinSchuh added a commit to AustinSchuh/glog that referenced this pull request Jun 22, 2024
google#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.

Signed-off-by: Austin Schuh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom InstallFailureFunction does not prevent exit
2 participants