proxygen
folly::LogStream Class Reference

#include <LogStream.h>

Inheritance diagram for folly::LogStream:

Public Member Functions

 LogStream (LogStreamProcessor *processor)
 
 ~LogStream ()
 
bool empty () const
 
std::string extractString ()
 
LogStreamProcessorgetProcessor () const
 

Private Attributes

LogStreamBuffer buffer_
 
LogStreamProcessor *const processor_
 

Detailed Description

A std::ostream implementation for use by the logging macros.

All-in-all this is pretty similar to std::stringstream, but lets us destructively extract an rvalue-reference to the underlying string.

Definition at line 60 of file LogStream.h.

Constructor & Destructor Documentation

folly::LogStream::LogStream ( LogStreamProcessor processor)
explicit

Definition at line 49 of file LogStream.cpp.

References buffer_.

50  : std::ostream(nullptr), processor_{processor} {
51  rdbuf(&buffer_);
52 }
LogStreamProcessor *const processor_
Definition: LogStream.h:84
LogStreamBuffer buffer_
Definition: LogStream.h:83
folly::LogStream::~LogStream ( )

Definition at line 54 of file LogStream.cpp.

54 {}

Member Function Documentation

bool folly::LogStream::empty ( ) const
inline

Definition at line 70 of file LogStream.h.

References buffer_.

70  {
71  return buffer_.empty();
72  }
bool empty() const
Definition: LogStream.h:36
LogStreamBuffer buffer_
Definition: LogStream.h:83
std::string folly::LogStream::extractString ( )
inline

Definition at line 74 of file LogStream.h.

References buffer_.

74  {
75  return buffer_.extractString();
76  }
LogStreamBuffer buffer_
Definition: LogStream.h:83
std::string extractString()
Definition: LogStream.h:40
LogStreamProcessor* folly::LogStream::getProcessor ( ) const
inline

Definition at line 78 of file LogStream.h.

Referenced by folly::LogStreamVoidify< true >::operator&().

78  {
79  return processor_;
80  }
LogStreamProcessor *const processor_
Definition: LogStream.h:84

Member Data Documentation

LogStreamBuffer folly::LogStream::buffer_
private

Definition at line 83 of file LogStream.h.

Referenced by LogStream().

LogStreamProcessor* const folly::LogStream::processor_
private

Definition at line 84 of file LogStream.h.


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