z_logger_formatter (zotonic_core v1.0.0-rc.17)

This is the main module that exposes custom formatting to the OTP logger library (part of the kernel application since OTP-21).

Adapted from logjam, added pretty print of reports and stack traces.

Summary

Types

metakey/0

-type metakey() :: atom() | [atom()].

template/0

-type template() :: [metakey() | {metakey(), template(), template()} | {atom()} | string()].

Functions

apply_defaults(UserConfig)

format(LogEvent, Config)

-spec format(LogEvent, Config) -> unicode:chardata()
                when LogEvent :: logger:log_event(), Config :: logger:formatter_config().

format_log(Tpl, Config, Msg, Meta)

-spec format_log(template(), Config, Msg, Meta) -> unicode:chardata()
                    when
                        Config :: logger:formatter_config(),
                        Msg :: Data,
                        Meta :: Data,
                        Data :: #{string() | binary() | atom() => term()}.

format_msg(Data, Config)

format_to_binary(Format, Terms)

pretty_stack(Stack, Config)

string_to_binary(String)

to_string(X, C)

truncate_value(V)