proxygen
|
#include <LogWriter.h>
Public Types | |
enum | Flags : uint32_t { NO_FLAGS = 0x00, NEVER_DISCARD = 0x01 } |
Public Member Functions | |
virtual | ~LogWriter () |
virtual void | writeMessage (folly::StringPiece buffer, uint32_t flags=0)=0 |
virtual void | writeMessage (std::string &&buffer, uint32_t flags=0) |
virtual void | flush ()=0 |
virtual bool | ttyOutput () const =0 |
LogWriter defines the interface for processing a serialized log message.
Definition at line 25 of file LogWriter.h.
enum folly::LogWriter::Flags : uint32_t |
Bit flag values for use with writeMessage()
Enumerator | |
---|---|
NO_FLAGS | |
NEVER_DISCARD |
Ensure that this log message never gets discarded. Some LogWriter implementations may discard messages when messages are being received faster than they can be written. This flag ensures that this message will never be discarded. This flag is used to ensure that LOG(FATAL) messages never get discarded, so we always report the reason for a crash. |
Definition at line 30 of file LogWriter.h.
|
inlinevirtual |
|
pure virtual |
Block until all messages that have already been sent to this LogWriter have been written.
Other threads may still call writeMessage() while flush() is running. writeMessage() calls that did not complete before the flush() call started will not necessarily be processed by the flush call.
Implemented in folly::AsyncFileWriter, folly::ImmediateFileWriter, and folly::TestLogWriter.
Referenced by writeMessage().
|
pure virtual |
Is the log writer writing to a tty or not.
Implemented in folly::AsyncFileWriter, folly::ImmediateFileWriter, and folly::TestLogWriter.
Referenced by writeMessage().
|
pure virtual |
Write a serialized log message.
The flags parameter is a bitwise-ORed set of Flag values defined above.
Implemented in folly::AsyncFileWriter, folly::ImmediateFileWriter, and folly::TestLogWriter.
Referenced by writeMessage(), and ~LogWriter().
|
inlinevirtual |
Write a serialized message.
This version of writeMessage() accepts a std::string&&. The default implementation calls the StringPiece version of writeMessage(), but subclasses may override this implementation if desired.
Reimplemented in folly::AsyncFileWriter.
Definition at line 62 of file LogWriter.h.
References flush(), ttyOutput(), and writeMessage().