proxygen
folly::LogStreamVoidify< true > Class Template Reference

#include <LogStreamProcessor.h>

Public Member Functions

void operator& (std::ostream &)
 

Detailed Description

template<>
class folly::LogStreamVoidify< true >

Definition at line 487 of file LogStreamProcessor.h.

Member Function Documentation

void folly::LogStreamVoidify< true >::operator& ( std::ostream &  stream)

A specialized noreturn version of operator&() for fatal log statements.

Definition at line 214 of file LogStreamProcessor.cpp.

References folly::LogStream::getProcessor(), folly::LogStreamProcessor::logNow(), and folly::LogStreamProcessor::stream().

214  {
215  // Non-fatal log messages wait until the LogStreamProcessor destructor to log
216  // the message. However for fatal messages we log immediately in the &
217  // operator, since it is marked noreturn.
218  //
219  // This does result in slightly larger emitted code for fatal log messages
220  // (since the operator & call cannot be completely omitted). However, fatal
221  // log messages should typically be much more rare than non-fatal messages,
222  // so the small amount of extra overhead shouldn't be a big deal.
223  auto& logStream = static_cast<LogStream&>(stream);
224  logStream.getProcessor()->logNow();
225  abort();
226 }
StreamCodecFactory stream

The documentation for this class was generated from the following files: