mettle
mettle copied to clipboard
Support redirecting terminal output during tests to a logfile
(Spun out from #33)
Instead of having to choose between suppressing terminal output and showing it in-line with your test results, there should be a way to pipe it to a file (or possibly multiple files; maybe one per test run?). This might look something like the following:
--print-terminal: Renamed from--show-terminal, used for printing to the console--pipe-terminal: Pipe to a file; by default, this would be something likemettle-{date}.log, but users could specify a different filename (possibly as a format string to fill in the current date?)
It is important to be able to redirect stdout and stderr to the dedicated files.
So, either something like --pipe-stdout and --pipe-stderr should be provided,
or the --pipe-terminal should support both specification of the redirecting output stream(s) and the output file having 2 parameters. The latter might be confusing because it requires to apply double option to redirect streams to distinct files: --pipe-terminal stdout <stdout_file> --pipe-terminal stderr <stderr_file>.
--pipe-stdout/--pipe-stderr probably makes the most sense then (though I guess it's not really a pipe, so I'll have to make a better name).