Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExUnit.CaptureLog doesn't work properly anymore #5

Open
wpiekutowski opened this issue Aug 29, 2023 · 0 comments
Open

ExUnit.CaptureLog doesn't work properly anymore #5

wpiekutowski opened this issue Aug 29, 2023 · 0 comments

Comments

@wpiekutowski
Copy link

Due to elixir-lang/elixir#12879, I've switched to the legacy logger backend from this repo. It works fine – logs output to console as it used to.

Expected behaviour

capture_log should capture log output, so assertions can be run and no output should be visible in the terminal.

Actual behaviour

Tests that use capture_log output logs to the console. The log gets captured and tests pass as they used to. ex_unit docs state that :console log backend is captured, so this kind of makes sense.

Partial solution

# test.exs

config :logger, backends: [:console]
config :logger, :console, []

This makes capturing work properly – no output to the console, but also no output from log entries that aren't captured, so some issues might be potentially missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant