mirror of
https://github.com/valitydev/woody_erlang.git
synced 2024-11-06 02:15:19 +00:00
Remove extra get_formatter_opts/1 (#125)
* Remove extra get_formatter_opts/1 * Change defaults to max length and max printable string length * Typo
This commit is contained in:
parent
205982e6c0
commit
ce178d0232
@ -11,6 +11,7 @@
|
||||
-define(MAX_FLOAT_DECIMALS, 8).
|
||||
%% Binaries under size below will log as-is.
|
||||
-define(MAX_BIN_SIZE, 40).
|
||||
-define(MAX_LENGTH, 1000).
|
||||
|
||||
-type limit() :: non_neg_integer() | unlimited.
|
||||
|
||||
@ -374,7 +375,7 @@ to_string(_) ->
|
||||
normalize_options(Opts) ->
|
||||
maps:merge(#{
|
||||
max_depth => unlimited,
|
||||
max_length => unlimited,
|
||||
max_length => ?MAX_LENGTH,
|
||||
max_printable_string_length => ?MAX_BIN_SIZE
|
||||
}, Opts).
|
||||
|
||||
|
@ -227,8 +227,7 @@ format_event_and_meta(Event, Meta, RpcID, EssentialMetaKeys) ->
|
||||
-spec format_event_and_meta(event(), event_meta(), woody:rpc_id() | undefined, list(meta_key()), options()) ->
|
||||
{severity(), msg(), meta()}.
|
||||
format_event_and_meta(Event, Meta, RpcID, EssentialMetaKeys, Opts) ->
|
||||
FormatOpts = get_formatter_opts(Opts),
|
||||
{Severity, Msg} = format_event(Event, Meta, RpcID, FormatOpts),
|
||||
{Severity, Msg} = format_event(Event, Meta, RpcID, Opts),
|
||||
{Severity, Msg, get_essential_meta(Meta, Event, EssentialMetaKeys)}.
|
||||
|
||||
get_essential_meta(Meta, Event, Keys) ->
|
||||
|
Loading…
Reference in New Issue
Block a user