Applies the ImmediateFlushing (see companion object) buffering policy to the StackableReceiver it is mixed into.
Applies the LazyFlushing (see companion object) buffering policy to the StackableReceiver it is mixed into.
Applies the PeriodicFlushing (see companion object) buffering policy to the StackableReceiver it is mixed into.
Applies the PeriodicFlushing (see companion object) buffering policy to the StackableReceiver it is mixed into.
Override the maximumFlushInterval
member to change the frequency of automatic flushes.
Flushes a Receiver immediately after each entry is received.
Disables automatic flushing of a Receiver.
Periodically flushes a Receiver at the default frequency (5 seconds).
Periodically flushes a Receiver at the default frequency (5 seconds). The receiver may flush more often than this interval in other scenarios (e.g., when buffer capacity is reached).
The interval is dependent only on flushes that are initiated from the receiver, either explicitly through its
flush()
method or automatically through the periodic schedule. It does not take into account flushes that
occur in the underlying objects.
Contains the composable Receiver buffering policies available in timber. These only affect how often the receiver is flushed by timber. Many receivers will be based on instances of other classes that are themselves buffered (e.g., BufferedWriters and BufferedOutputStreams). While the flushes that timber instigates should make it down to the underlying objects, those objects may also flush for other reasons (e.g., their buffer reaching capacity). So, this buffering policy may not be the only source of flushes.
Each of the policies has two flavors. The first is a trait that can be used to mixin to a StackableReceiver. The second is an object that can be used as an argument to the
file()
method in the DSL.