TFileWriterTransport

A transport used to write log files. It can never be read from, calling read() throws.

Contrary to the C++ design, explicitly opening the transport/file before using is necessary to allow manually closing the file without relying on the object lifetime.

Constructors

this
this(string path)

Creates a new file writer transport.

Members

Functions

chunkSize
ulong chunkSize()
void chunkSize(ulong value)

The size of the chunks the file is divided into, in bytes.

close
void close()

Closes the transport, i.e. the underlying file and the writer thread.

eventBufferSize
size_t eventBufferSize()
void eventBufferSize(size_t value)

The maximum number of write() calls buffered, or zero for no limit.

flush
void flush()

Flushes any pending data to be written.

ioErrorSleepDuration
Duration ioErrorSleepDuration()
void ioErrorSleepDuration(Duration value)

When the writer thread encounteres an I/O error, it goes pauses for a short time before trying to reopen the output file. This controls the sleep duration.

isOpen
bool isOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
maxFlushBytes
size_t maxFlushBytes()
void maxFlushBytes(size_t value)

Maximum number of bytes buffered before writing and flushing the file to disk.

maxFlushInterval
Duration maxFlushInterval()
void maxFlushInterval(Duration value)

Maximum interval between flushing the file to disk.

open
void open()
Undocumented in source. Be warned that the author may not have intended to support it.
peek
bool peek()

A file writer transport can never be read from.

write
void write(ubyte[] buf)

Enqueues the passed slice of data for writing and immediately returns. write() only blocks if the event buffer has been exhausted.

Manifest constants

DEFAULT_EVENT_BUFFER_SIZE
enum DEFAULT_EVENT_BUFFER_SIZE;

The maximum number of write() calls buffered, or zero for no limit.

DEFAULT_IO_ERROR_SLEEP_DURATION
enum DEFAULT_IO_ERROR_SLEEP_DURATION;

When the writer thread encounteres an I/O error, it goes pauses for a short time before trying to reopen the output file. This controls the sleep duration.

DEFAULT_MAX_FLUSH_BYTES
enum DEFAULT_MAX_FLUSH_BYTES;

Maximum number of bytes buffered before writing and flushing the file to disk.

DEFAULT_MAX_FLUSH_INTERVAL
enum DEFAULT_MAX_FLUSH_INTERVAL;

Maximum interval between flushing the file to disk.

Inherited Members

From TBaseTransport

isOpen
bool isOpen()
Undocumented in source. Be warned that the author may not have intended to support it.
peek
bool peek()
Undocumented in source. Be warned that the author may not have intended to support it.
open
void open()
Undocumented in source. Be warned that the author may not have intended to support it.
close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
read
size_t read(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
readAll
void readAll(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
readEnd
size_t readEnd()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(ubyte[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
writeEnd
size_t writeEnd()
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
borrow
const(ubyte)[] borrow(ubyte* buf, size_t len)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
void consume(size_t len)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta