annotation
Logbuch::Annotations::Logged
Overview
Traces a method of a class, struct or module. Its positional arguments are told apart by what they are, in any order:
- a string: the description, such as
"placing the order", which the messages are built from; - a level,
:trace(the default) to:fatal, or aLog::Severitymember such asLog::Severity::Debug: the severity of the entry and exit lines; - a detail,
:omit,:id,:summary(the default) or:full, or aLogbuch::Detailmember such asLogbuch::Detail::Full: how much of the arguments and the result is logged.
Its named options:
timing:whether the lines carryduration_ns, on by default;result:a block in arrow notation with one parameter, whose result is logged instead of the method's result;slow:a named tuple such as{ms: 200, level: :warn}: the exit line of a call that took at least 200 ms is written at:warn, the default level, which must be above the method's level, and carriesslow: true; withargs: true, it also carries the arguments when the entry line is disabled;lock:a lock, such as@lock, held while the arguments and the result are converted, but not while the method runs;log:the log the lines go to instead of the type's: a source name such as"shop.export", a name below the type's log such as".export", or a constant that holds aLog.