Timber v1.0.13 Timber
The functions in this module work by modifying the Logger metadata store which is unique to every BEAM process. This is convenient in many ways. First and foremost, it does not require you to manually manage the metadata. Second, because we conform to the standard Logger principles, you can utilize Timber alongside other Logger backends without issue. Timber prefixes its contextual metadata keys so as not to interfere with other systems.
The Context Stack
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.HTTPClientRequestEvent
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.HTTPClientRequestEvent
:
timer = Timber.start_timer()
# .... make request
time_ms = Timber.duration_ms(timer)
event = HTTPClientResponseEvent.new(status: 200, time_ms: time_ms)
message = HTTPClientResponseEvent.message(event)
Logger.info(message, event: event)