Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package scalawag
    Definition Classes
    org
  • package timber
    Definition Classes
    scalawag
  • package backend
    Definition Classes
    timber
  • package receiver

    Contains all of the built-in support for receivers, which are the leaves of dispatcher routing graphs.

    Contains all of the built-in support for receivers, which are the leaves of dispatcher routing graphs. Receivers do something with entries. Exactly what they do depends on the implementation.

    Definition Classes
    backend
  • package buffering

    Contains the composable Receiver buffering policies available in timber.

    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.

    Definition Classes
    receiver
  • package concurrency

    Contains the composable Receiver concurrency policies available in timber.

    Contains the composable Receiver concurrency policies available in timber. These determine whether concurrent access to the various Receiver methods is allowed.

    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.

    Definition Classes
    receiver
  • package formatter

    Contains functionality for turning log entries into text.

    Contains functionality for turning log entries into text.

    Definition Classes
    receiver
  • ConsoleErrReceiver
  • ConsoleOutReceiver
  • DelegatingReceiver
  • Receiver
  • WriterBasedReceiver
  • WriterBasedStackableReceiver
c

org.scalawag.timber.backend.receiver

WriterBasedReceiver

class WriterBasedReceiver extends Receiver

Implements a Receiver that formats entries with an EntryFormatter and then writes them to a Writer. The Writer is specified using a writer creation function so that this receiver can recreate the Writer as many times as it needs to. This may happen if close() is called before the last time receive(Entry) is called. When receive(Entry) is called after close(), the function is used to recreate the Writer. This functionality is used to support logrotate integration (or other utilities that would need a log file to be reopened).

Linear Supertypes
Receiver, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WriterBasedReceiver
  2. Receiver
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new WriterBasedReceiver(createWriterFn: => Writer)(implicit formatter: EntryFormatter = DefaultEntryFormatter)

    createWriterFn

    a function that creates the Writer which entries should be written to

    formatter

    the formatter used to format the entries before writing them

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def close(): Unit

    Closes the receiver.

    Closes the receiver. This means that the resources held by this receiver should be released in preparation for it being decommissioned. This usually happens before system shutdown, but it does not necessarily mean that this receiver will not receive any more entries. Receviers can be closed simply to release file system or network resources.

    This method must handle any flushing that is required prior to any resource deallocation. Timber will not necessarily call flush() before close().

    Definition Classes
    WriterBasedReceiverReceiver
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. def flush(): Unit

    Tells this receiver to flush any buffered entries that it has received but not yet fully processed.

    Tells this receiver to flush any buffered entries that it has received but not yet fully processed. This makes it possible for this receiver to improve performance by batching I/O work.

    Definition Classes
    WriterBasedReceiverReceiver
  11. def flushAtLeastEvery(duration: FiniteDuration): Receiver
    Definition Classes
    Receiver
  12. def flushImmediately: Receiver
    Definition Classes
    Receiver
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. def receive(entry: Entry): Unit

    Receives an Entry for processing.

    Receives an Entry for processing. There is no initialization method for receivers, so this method must handle resource initialization on the first call after construction or after closure.

    entry

    the entry being received by this receiver

    Definition Classes
    WriterBasedReceiverReceiver
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. def withLocking: Receiver
    Definition Classes
    Receiver
  26. def withQueueing: Receiver
    Definition Classes
    Receiver

Inherited from Receiver

Inherited from AnyRef

Inherited from Any

Ungrouped