mettle icon indicating copy to clipboard operation
mettle copied to clipboard

Support redirecting terminal output during tests to a logfile

Open jimporter opened this issue 7 years ago • 2 comments
trafficstars

(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 like mettle-{date}.log, but users could specify a different filename (possibly as a format string to fill in the current date?)

jimporter avatar Mar 07 '18 02:03 jimporter

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>.

luav avatar Mar 07 '18 08:03 luav

--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).

jimporter avatar Mar 08 '18 00:03 jimporter