z_logger_formatter (zotonic_core v1.0.0-rc.12)

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

The module honors the standard configuration of the kernel's default logger formatter regarding: max depth, templates.

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

Link to this section Summary

Link to this section Types

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

Link to this section Functions

Link to this function

apply_defaults(UserConfig)

Link to this function

format(LogEvent, Config)

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

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()}.
Link to this function

format_msg(Data, Config)

Link to this function

format_to_binary(Format, Terms)

Link to this function

pretty_stack(Stack, Config)

Link to this function

string_to_binary(String)

Link to this function

to_string(X, C)