Skip to content

Commit

Permalink
Allow throwing from exit handler
Browse files Browse the repository at this point in the history
For example for unit testing purposes we may want to replace SIGABRT with
throwing an exception, so that unit tests for CHECK()s can be written.
  • Loading branch information
ripopov committed May 8, 2020
1 parent aab25a4 commit 48650a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/g3log/logcapture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct LogCapture {
// At destruction the message will be forwarded to the g3log worker.
// In the case of dynamically (at runtime) loaded libraries, the important thing to know is that
// all strings are copied, so the original are not destroyed at the receiving end, only the copy
virtual ~LogCapture();
virtual ~LogCapture() noexcept (false);



Expand Down
2 changes: 1 addition & 1 deletion src/logcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void g3::only_change_at_initialization::setMaxMessageSize(size_t max_size) {
* As a safety precaution: No memory allocated here will be moved into the background
* worker in case of dynamic loaded library reasons instead the arguments are copied
* inside of g3log.cpp::saveMessage*/
LogCapture::~LogCapture() {
LogCapture::~LogCapture() noexcept (false) {
using namespace g3::internal;
SIGNAL_HANDLER_VERIFY();
saveMessage(_stream.str().c_str(), _file, _line, _function, _level, _expression, _fatal_signal, _stack_trace.c_str());
Expand Down

0 comments on commit 48650a9

Please sign in to comment.