module Logbuch::Keys

Overview

The keys of the data on a trace line, for queries and formatters that read them. A line's data is a Log::Metadata, whose keys are symbols; an error's type, message and cause are keys of a hash inside it, which are strings.

entry.data[Logbuch::Keys::RESULT]?
entry.data[Logbuch::Keys::ERROR].as_h[Logbuch::Keys::MESSAGE]

Defined in:

logbuch/line_data.cr

Constant Summary

ARGS = :args

The arguments, a hash with one key per argument; on the entry line.

CAUSE = "cause"

An exception's cause, converted like the exception.

DURATION = :duration_ns

The call's duration in whole nanoseconds; on the exit line, and on the error line when the method's level is enabled.

ERROR = :error

The exception; on the error line.

MESSAGE = "message"

An exception's message.

METHOD = :method

The traced method's label, such as "Shop::Checkout#place"; on every line.

RESULT = :result

The result, or an accepted exception; on the exit line.

SLOW = :slow

true on the exit line of a call that took at least its slow: threshold; left out of every other line.

TYPE = "type"

An exception's class name.