How to change log level (logger) during test?

bengt cean.ebengt@REDACTED
Sat Dec 12 17:36:27 CET 2020


Greetings,


For documentation I answer my own question.

To change the log level I had to do
logger:set_handler_config( ‘Elixir.logger’, level, warning )

My application includes tzdata. It is written in Elixir and does something to the log system that caused my confusion. Or the rebar3 plugin rebar_mix does it.

If somebody knows of a way to get the default handler instead of ‘Elixir.logger’ it would be great.


Best Wishes,
bengt 

> On 29 Nov 2020, at 16:23, bengt <cean.ebengt@REDACTED> wrote:
> 
> Greetings,
> 
> While running Common Test suites I get too many log messages (from info level). What should I do to change the log level?
> Erlang OTP 23, logger. No log config, that I set.
> 
> I have tried:
> logger:set_primary_config( level, warning ) in init_per_suite/1. It returns ok, but info log continue.
> Also tried set_module_level/2. Same result.
> 
> 
> Best Wishes,
> bengt



More information about the erlang-questions mailing list