Closed pggalaviz closed 5 years ago
If you're starting your local cluster in test
, then the started nodes will also be in test
. Can you log out Mix.env()
from a remote node and see what comes up?
It returns :test
, nothing wrong there.
Looking at Swarm's cluster test helper:
https://github.com/bitwalker/swarm/blob/14302120fdec9b16c3368df6dd143b583d5d901e/test/support/cluster.ex#L44
Seems they set the logger
level by passing it as an argument when starting the node.
Could this fix the logging issue?
If I log Logger.level()
from a node it returns :debug
instead of :warn
.
@pggalaviz want to fork and try it out? Happy to merge a PR if that fixes it for you. Here is the likely line.
@pggalaviz this should be ok now in v1.0.3, want to try it out?
Working fine! No more unwanted logs 👍
Is there a way to start the nodes with test env (MIX_ENV=test)? I'm using Swarm as a dependency, and by default it logs a lot of data when running in dev mode (info and debug). While using Local Cluster in a test, I can see all the logs Swarm produces from all nodes on the test cluster as they're running with dev environment.
Is there a way to prevent all these logs to appear during tests but keep them for dev?