Is it possible to suppress warnings when running mix phx.server

I have a rather large project that I have inherited from another team.

The project is full of warnings for unused variables, etc.

Running mix phx.server outputs these errors after every request, and they are flooding my console.

Is it possible to temporarily suppress these errors so that I can sort through the problem at hand?

Thanks!

2 Likes

Have you tried mix compile --no-debug-info?
But then you woudn’t see anything… :thinking:
How much would it take to resolve compile warnings? :sweat_smile:

What errors though? Your post contains none.

it would take an incredible amount of time to resolve the compile warnings. I plan to attack them one file at a time during each session… and maybe have them all wrapped up in a few weeks.

I just tried mix compile --no-debug-info and then mix phx.server, but I am still flooded with warnings.

i may have misspoken. I am trying to see the errors… but i have so many warnings, i can’t see past them to see the errors.

Ah. Well I can’t answer your original question but you can always configure your terminal program to have 1 million lines of scroll-back and then start the app and scroll all the way to the top. :smiley:

If it’s coming from logger then
config :logger, level: :error or higher level in dev config.

5 Likes

i have a feeling a million lines won’t be enough…

2 Likes

I tried this … and I still get all the warnings with every page load.

Once you know what you’re looking for you can use Ctrl + F to find it easily again. Terminator supports finder.

OK then, suppress the output to the console and put it in a file e.g.

mix phx.server >tee app.log

Or don’t suppress it, let it be visible but then let it also stream to a log file:

mix phx.server | tee app.log

Then inspect the file from the beginning.

1 Like

Can you try running with mix do compile --no-all-warnings, phx.server?
This should suppress the warnings after the first compilation to only changed files.
And later you should only get warnings on files you change.

I ended up digging into fixing files, and talking to everyone… so that we never do this again.

Thanks for all the help!

3 Likes

Okay, but what was the problem?