An implementation of folly::AsyncLogWriter that writes log messages into a file.
Declared in <folly/logging/AsyncFileWriter.h>
class AsyncFileWriter
: public AsyncLogWriter
See folly::AsyncLogWriter for details on asynchronous IO.
| Name | Description |
|---|---|
AsyncLogWriter | An abstract LogWriter implementation that provides functionality for asynchronous IO operations. Users can subclass this class and provide their own IO operation implementation by overriding performIO method. This class will automatically manage incoming log messages and call the method in appropriate time. |
| Name | Description |
|---|---|
DiscardCallback | Callback type invoked with the number of discarded messages. |
| Name | Description |
|---|---|
Flags | Bit flag values for use with writeMessage() |
| Name | Description |
|---|---|
AsyncFileWriter [constructor] | Constructors |
~AsyncFileWriter [destructor] [virtual] | Destroys the writer, flushing any pending output. |
flush [virtual] | Block until the I/O thread has finished writing all messages that were already enqueued when flush() was called. |
getFile | Get the output file. |
getMaxBufferSize | Get the maximum buffer size for this AsyncLogWriter, in bytes. |
setMaxBufferSize | Set the maximum buffer size for this AsyncLogWriter, in bytes. |
ttyOutput [virtual] | Returns true if the output steam is a tty. |
writeMessage | Enqueues a serialized message for asynchronous writing. |
writeMessageSync [virtual] | Write a message synchronously. |
| Name | Description |
|---|---|
setDiscardCallback | Set a callback to be invoked when log messages have been discarded. |
| Name | Description |
|---|---|
kDefaultMaxBufferSize | The default maximum buffer size. |
| Name | Description |
|---|---|
cleanup | Drain up the log message queue. Subclasses must call this method in their destructors to avoid losing log messages at shutdown. |