Timber v2.2.1 Timber.LoggerBackend View Source

The LoggerBackend module is at the heart of Timber’s integration. It specifies a backend that can be used with the standard Logger application distributed with Elixir.

This module integrates with the transport mechanism you specify, and is responsible for receiving log events, determining whether the event is appropriate to output, and compiling the context data. Individual transports are responsible for maintaining buffers and whether the output should be asynchronous or synchronous.

Link to this section Summary

Types

The level of a log event is described as an atom

The message for a log event is given as IO.chardata. It is important not to assume the message will be a String.t/0

The precision of the microsecond represents the precision with which the fractional seconds are kept

t()

A representation of stateful data for this module

Time is represented both to the millisecond and to the microsecond with precision

Link to this section Types

Link to this type hour() View Source
hour() :: 0..23

The level of a log event is described as an atom

The message for a log event is given as IO.chardata. It is important not to assume the message will be a String.t/0

Link to this type microsecond() View Source
microsecond() :: 0..999999
Link to this type millisecond() View Source
millisecond() :: 0..999
Link to this type minute() View Source
minute() :: 0..59
Link to this type month() View Source
month() :: 1..12
Link to this type precision() View Source
precision() :: 0..6

The precision of the microsecond represents the precision with which the fractional seconds are kept.

See Calendar.microsecond/0 for more information.

Link to this type second() View Source
second() :: 0..59
Link to this type t() View Source
t() :: %Timber.LoggerBackend{min_level: level | nil, transport: module, transport_state: Timber.Transport.state}

A representation of stateful data for this module

min_level

The minimum level to be logged. The Elixir Logger module typically handle filtering the log level, however this is a stop-gap for direct testing as well as any custom levels.

transport

The transport module as an atom. This will be fetched at startup from the configuration.

transport_state

The transport state. This is initialized by calling init/1 on the transport with transport configuration data from the application config.

Time is represented both to the millisecond and to the microsecond with precision.

Link to this type timestamp() View Source
timestamp() :: {date, time}
Link to this type year() View Source
year() :: pos_integer