macula_reason_name (macula v11.4.0)
View SourceWhat a reason is called when it leaves this node, and how much of it the local log prints.
A peer, a remote caller or a published fact is told a reason's name and none of its terms. The name is the atom at the reason's head, such as killed, shutdown, timeout or badmatch, looking through {error, Reason} and at most three tuples deep. A reason with no such atom, or whose atom's name is longer than 64 bytes, has no name.
An error a handler answers its caller with may carry the handler's own text: a binary, or a list whose first 257 elements, or all of them if fewer, are printable Unicode characters. Only those elements of a list are looked at, however long it is. The text crosses as at most 256 bytes of valid UTF-8, cut on a character boundary.
The whole reason stays on this node, where logged/2 prints it for the log to at most 4,096 characters however large it is.
Summary
Functions
Format and Args printed for the local log, to at most 4,096 characters however large the terms in Args are. The print stops early on large terms, and what it gives is cut to the bound.
The text a caller is told for an error a handler answered with: the handler's own text when the reason is a binary or a list whose first 257 elements are printable Unicode characters, as at most 256 bytes of valid UTF-8; otherwise the reason's name; error when the reason has neither.
The reason's name, such as <<"timeout">>, or <<"crashed">> when it has none. This is what an end fact or an abort message says about why something ended.
Functions
-spec logged(io:format(), [term()]) -> unicode:chardata().
Format and Args printed for the local log, to at most 4,096 characters however large the terms in Args are. The print stops early on large terms, and what it gives is cut to the bound.
The text a caller is told for an error a handler answered with: the handler's own text when the reason is a binary or a list whose first 257 elements are printable Unicode characters, as at most 256 bytes of valid UTF-8; otherwise the reason's name; error when the reason has neither.
The reason's name, such as <<"timeout">>, or <<"crashed">> when it has none. This is what an end fact or an abort message says about why something ended.