Timber v2.5.4 Timber View Source
The functions in this module are high level convenience functions instended to define the broader / public API of the Timber library. It is recommended to use these functions instead of their deeper counterparts.
Link to this section Summary
Functions
Adds a context entry to the stack. See Timber::Contexts::CustomContext
for examples
Captures the duration in fractional milliseconds since the timer was started. See
start_timer/0
Used to time runtime execution. For example, when timing a Timber.Events.HTTPResponseEvent
Link to this section Functions
add_context(map | Keyword.t | Timber.Context.context_element) :: :ok
Adds a context entry to the stack. See Timber::Contexts::CustomContext
for examples.
Captures the duration in fractional milliseconds since the timer was started. See
start_timer/0
.
Used to time runtime execution. For example, when timing a Timber.Events.HTTPResponseEvent
:
timer = Timber.start_timer()
# .... make request
time_ms = Timber.duration_ms(timer)
event = HTTPResponseEvent.new(status: 200, time_ms: time_ms)
message = HTTPResponseEvent.message(event)
Logger.info(message, event: event)