file_logger& operator<<(std::ostream& (*f)(std::ostream&)){ // get the stream buffer logger_impl::streambuff_tls_entry* streambufentry = reinterpret_cast<logger_impl::streambuff_tls_entry*>( pthread_getspecific(streambuffkey)); if (streambufentry != NULL) { std::stringstream& streambuffer = streambufentry->streambuffer; bool& streamactive = streambufentry->streamactive; typedef std::ostream& (*endltype)(std::ostream&); if (streamactive) { if (endltype(f) == endltype(std::endl)) { streambuffer << "\n"; stream_flush(); if(streamloglevel == LOG_FATAL) { throw "log fatal"; // exit(EXIT_FAILURE); } } } } return *this; }
inline file_logger& operator<<(std::ostream& (*f)(std::ostream&)){ // get the stream buffer logger_impl::streambuff_tls_entry* streambufentry = reinterpret_cast<logger_impl::streambuff_tls_entry*>( pthread_getspecific(streambuffkey)); if (streambufentry != NULL) { std::stringstream& streambuffer = streambufentry->streambuffer; bool& streamactive = streambufentry->streamactive; typedef std::ostream& (*endltype)(std::ostream&); if (streamactive) { if (endltype(f) == endltype(std::endl)) { streambuffer << "\n"; stream_flush(); if(streamloglevel == LOG_FATAL) { __print_back_trace(); GRAPHLAB_LOGGER_FAIL_METHOD("LOG_FATAL encountered"); } } } } return *this; }