Timber v0.1.2 Timber.Logger

The Logger 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.

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

Types

date()
date :: {year, month, day}
day()
day :: 1..31
hour()
hour :: 0..23

The level of a log event is described as an atom

message()

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

microsecond()
microsecond :: 0..999999
millisecond()
millisecond :: 0..999
minute()
minute :: 0..59
month()
month :: 1..12
precision()
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.

second()
second :: 0..59
t()
t :: %Timber.Logger{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.

timestamp()
year()
year :: pos_integer