I’ve written down the requirements for a perfect log command:
show stdout/stderr of the script in tty while the script is running
show colors produced by the script in tty while the script is running
create a log file of all stdout/stderr the script produced
have the log without colors
don’t break the ability to read input from stdin
Apparently no such jack of all trades device has been found. The following command fulfills all requirements everything, but stripping colors from the log.
sudo script -a -f ~/log -c "./whonix_build --build --tor-gateway"
Stripping the color from the log is possible as well.
[quote=“Patrick, post:7, topic:89”][quote author=Occq link=topic=70.msg605#msg605 date=1393189348]
There is one problem with the build script error handler.
If the build fails in the middle (for whatever reason, like if you forgot to set disk space to more than 8GB. Stupid mistake) the script keeps running because it requires user input. That is highly impractical for those of us who use input log redirection. We don’t see the question, we can’t answer it.
"Please enter c and press enter to continue..
"Please enter to cleanup and exit"
Short term solution is to delete user input option and end the script when it breaks (no continue choice, direct auto exit).
Oh and bare metal was run successfull with India as the location (the same settings failed in the last version) so update-locale seems fixed.
[/quote]
I see. This is non-ideal. Should documented for now. And improved for Whonix 8 + 1.
I don’t want to entirely remove this feature. Has proven very useful in development. Could be disabled by default and enabled with a build configuration.[/quote]
So far the disabled-by-default option seems most easy to implement.
Why disable colors? Because it may help to strip colors from the log?
Colors are configured in help-steps/pre in function “colors”. By not running the “colors” function (which could be configured by a command line option, environment variable and/or build configuration), variables such as ${red} would be empty and therefore not producing any output, i.e. no color.
I personally like having colors in tty output. Makes following the process, noticing important messages, navigation, debugging simpler.
Colors encoding ([[0m ) that appears in a log are disturbing (IMO). If it’s either no colors or that encoding (00;32m) I would rather go with no colors.
Disabling user input by default gives us time to figure out something that works.