Skip to content

Commit

Permalink
Update test to require less code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivor committed Oct 1, 2024
1 parent 6fbdeff commit a5dfb74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Config

config :logger, :default_formatter, metadata: ~w(bar baz foo request_id)a
config :logger, :default_formatter, metadata: ~w(bar baz foo)a
4 changes: 2 additions & 2 deletions test/tesla/middleware/meta_logger_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ defmodule Tesla.Middleware.MetaLoggerTest do
end

test "when the max entry length is given and the logs are split, the metadata is captured with each line" do
Logger.metadata(request_id: "123123123")
Logger.metadata(foo: "123123123")

body = String.duplicate("x", 100)

Expand All @@ -242,7 +242,7 @@ defmodule Tesla.Middleware.MetaLoggerTest do

log_lines
|> Enum.each(fn log_line ->
assert log_line =~ "request_id=123123123"
assert log_line =~ "foo=123123123"
end)
end

Expand Down

0 comments on commit a5dfb74

Please sign in to comment.