Skip to content

Commit

Permalink
Handle improper list
Browse files Browse the repository at this point in the history
  • Loading branch information
reachfh committed Jul 21, 2024
1 parent 854693e commit cbde2c9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/logger_formatter_json_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,33 @@ unstructured(_) ->
)
)
),
?assertEqual(
<<
"{\"msg\":\"Postgrex.Protocol (<0.6341.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (postgres:5432): timeout\",\"level\":\"info\"}\n"
>>,
iolist_to_binary(
logger_formatter_json:format(
#{
level => info,
msg
=>
{
string,
[
<<"Postgrex.Protocol">>,
32,
40,
c:pid(0, 6341, 0),
<<") failed to connect: ">>
| <<"** (DBConnection.ConnectionError) tcp connect (postgres:5432): timeout">>
]
},
meta => #{}
},
Config
)
)
),
ok.


Expand Down

0 comments on commit cbde2c9

Please sign in to comment.