How do you deal with distracting shell tty output?
My application does cyclic error_logger reports.
These will be displayed on the Erlang shell which is quite a lot of output.
This makes typing into the shell quite a nuisance.
What is the usual way of dealing with this given that:
I really want to see this output
I'd don't like it all over the input line I just type
How to开发者_StackOverflow deal with this? Always have distribution on and connect with a second shell for user input (this is extra effort when starting the application, which I do often during development).
I'd prefer some automatic easily startable setup where all logging and sasl messages go one place and my input and return values is undisturbed in another place.
For reference this is how I start my sessions:
#!/bin sh
erl +W w -boot start_sasl -config myapp -s myapp -extra "$@"
In the docs for the kernel ( http://erlang.org/doc/man/kernel_app.html ) it described how to set your application environment variables to redirect error_logger printouts to a file or disable them completely. Something like this should work for you:
erl +W w -boot start_sasl -kernel error_logger '{file,"/tmp/log"}' -config myapp -s myapp -extra "$@"
there are also similar options which you can use for sasl printouts: http://erlang.org/doc/man/sasl_app.html
精彩评论