mercredi 27 décembre 2017

Supress Logger when testing

I wonder how to disable logging in Elixir when testing. In my current code I test for logger messages, so I don't want to disable it completely, but hide the messages until any test stop passing.

I'm using mix and ExUnit to manage and test my project.

mix test
Compiling 2 files (.ex)
.........
17:59:18.446 [warn]  Code seems to be empty
.
17:59:18.447 [warn]  Code doesn't contain HLT opcode
.
17:59:18.448 [warn]  Code doesn't contain HLT opcode

17:59:18.448 [error] Label error doesn't exist
.....

Finished in 0.07 seconds
16 tests, 0 failures

Aucun commentaire:

Enregistrer un commentaire