My Logger config level is not taking effect during mix tests

Hi folks –

Its been a while since I’ve been on here.

I just finished writing a basic_paxos library to help me understand this classic consensus protocol.

I’m having trouble setting the logger level and having it stick. When I run commands through iex it seems fine but when I run mix test I see logger output at the debug level as well which shouldn’t be happening since its been set to info. I’ve also tried blowing away the _build directory and retrying, but to no avail.

I would be surprised if I needed to explicitly add a config/test.exs file and set the logger level there as well, as I don’t remember that this was necessary.

I’ve pasted the first few lines of the mix test below (you can see the debug lines)

In https://github.com/brpandey/basic_paxos/blob/master/config/config.exs, I’ve set the logger level to info

config :logger,
  level: :info
brpandey@butterfly:~/Workspace/github/basic_paxos$ git pull
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0
Unpacking objects: 100% (4/4), done.
From github.com:brpandey/basic_paxos
   9ef6473..62f269c  master     -> origin/master
Updating 9ef6473..62f269c
Fast-forward
 config/config.exs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
brpandey@butterfly:~/Workspace/github/basic_paxos$ MIX_ENV=test mix clean
brpandey@butterfly:~/Workspace/github/basic_paxos$ MIX_ENV=test mix compile --force
Compiling 6 files (.ex)
Generated paxos app
brpandey@butterfly:~/Workspace/github/basic_paxos$ MIX_ENV=test mix test

12:06:37.242 [debug] Starting acceptor server paxos1@127.0.0.1

12:06:37.264 [debug] Starting acceptor server paxos2@127.0.0.1
1 Like

It looks like the nodes brought up through LocalCluster are not using your config.

Thank you. Wonder how I can connect the two