enum
Logbuch::Detail
Overview
How much of a value goes into a trace entry, from nothing to everything.
Defined in:
logbuch/detail.crEnum Members
-
Omit =
0 -
Never logged.
-
Id =
1 -
Identity only: what tells the value apart from others of its type.
- An object logs its identity. The same identity stands for the object in a cycle and past the depth limit, at every detail.
- With fields marked
@[LogAs(:id)], on the field or on theinitializeparameter that sets it, the identity is their values, each logged atId, so an object in one as its own identity: the one field's value, such as"o-17", or a hash of them by name, such as{"id" => "o-17", "zone" => "eu"}. They are read under the type'slock:. Where they lead back to an object whose identity is being logged, that object's id is…. - An opted-in class without such a field logs its object id instead,
as in
#<Order:0x10a3f2c40>. - An opted-in struct without such a field logs only its type, as in
#<Point>: anything taken from its fields could give away a redacted value. - A class or struct that did not opt in logs its
inspecttext, as it does at every other detail. A collection logs its object id, or for a set or a slice its type. - Each string of the identity is cut to the length limit, and the text
of one without
:idfields likeinspecttext. - Strings, numbers, characters, symbols, enums,
Bool,NilandTimeare their own identity and log as at any other detail, a string cut to the length limit. - So are the value types of the standard library a program has:
Complex,MIME::MediaType,Path,SemanticVersion,Socket::IPAddress,Socket::UNIXAddress,Time::Location,Time::Span,URIandUUIDlog theirto_stext at every detail, cut to the length limit, and aURIits password as***. - Collections, tuples and named tuples log each value at
Id, within the item limit, and a hash each key too, as it logs its keys at any detail (seeHash#to_trace). - An exception logs its type, message and cause, as at any other detail.
- A type with a
to_traceof its own decides for itself, readingTracer#detail.
-
Summary =
2 -
The important parts.
-
Full =
3 -
Everything.
Instance Method Summary
-
#full?
Returns
trueif this enum value equalsFull -
#id?
Returns
trueif this enum value equalsId -
#omit?
Returns
trueif this enum value equalsOmit -
#summary?
Returns
trueif this enum value equalsSummary