Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you deal with distracting shell tty output?

Tags:

shell

erlang

sasl

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:

  1. I really want to see this output

  2. I'd don't like it all over the input line I just type

How to 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 "$@" 
like image 634
Peer Stritzinger Avatar asked Jan 29 '26 05:01

Peer Stritzinger


1 Answers

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

like image 187
Lukas Avatar answered Jan 31 '26 22:01

Lukas