Skip to content

Commit

Permalink
Fix a failed test of ConsoleAdapter
Browse files Browse the repository at this point in the history
Follow the change of the log format as of console v1.24.

Signed-off-by: Takuro Ashie <[email protected]>
  • Loading branch information
ashie committed Apr 30, 2024
1 parent 284bf40 commit e8afa28
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/log/test_console_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@ def test_args(level)
fatal: :fatal)
def test_options(level)
@console_logger.send(level, "subject", kwarg1: "opt1", kwarg2: "opt2")
lines = @logdev.logs[0].split("\n")
args = JSON.load(lines[1..].collect { |str| str.sub(/\s+\|/, "") }.join("\n"));
assert_equal([
"#{@timestamp_str} [#{level}]: 0.0s: subject\n" +
" | {\"kwarg1\":\"opt1\",\"kwarg2\":\"opt2\"}\n"
1,
"#{@timestamp_str} [#{level}]: 0.0s: subject",
{ "kwarg1" => "opt1", "kwarg2" => "opt2" }
],
@logdev.logs)
[
@logdev.logs.size,
lines[0],
args
])
end

data(debug: :debug,
Expand Down

0 comments on commit e8afa28

Please sign in to comment.