Skip to content

Commit

Permalink
Log stacktrace instead of writing to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
pmconrad committed Sep 17, 2019
1 parent 0407979 commit 0922a16
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/thread/thread_d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <boost/thread.hpp>
#include <boost/atomic.hpp>

#include <iostream>
#include <sstream>
#include <vector>

namespace fc {
Expand Down Expand Up @@ -394,8 +394,10 @@ namespace fc {
* is probably just as likely to cause crashes */
if( std::current_exception() != std::exception_ptr() )
{
elog( "Thread ${name} yielded in exception handler!", ("name",thread::current().name()) );
print_stacktrace( std::cerr );
std::stringstream stacktrace;
print_stacktrace( stacktrace );
elog( "Thread ${name} yielded in exception handler!\n${trace}",
("name",thread::current().name())("trace",stacktrace.str()) );
assert( std::current_exception() != std::exception_ptr() );
}

Expand Down

0 comments on commit 0922a16

Please sign in to comment.