iperf icon indicating copy to clipboard operation
iperf copied to clipboard

Verbose output (--verbose) breaks JSON output (--json)

Open TheRealDJ opened this issue 2 years ago • 2 comments

Context

  • Version of iperf3: 3.11
  • Hardware: ODROID-C2
  • Operating system (and distribution, if any): Linux (Ubuntu 20.04 LTS)
  • Other relevant information (for example, non-default compilers, libraries, cross-compiling, etc.): N/A

Bug Report

  • Expected Behavior With --json specified, the output of STDOUT should be working JSON
  • Actual Behavior With --verbose in conjunction with --json, the verbose output messages are sent to STDOUT along with JSON, breaking JSON
  • Steps to Reproduce iperf3 --client XXX ... --verbose --json
  • Possible Solution Output verbose messages to STDERR (at least when --json is used also).

TheRealDJ avatar Aug 01 '22 21:08 TheRealDJ

On one hand, this behavior shouldn't be a surprise because iperf3 prints this warning if you try to use those two features together:

warning: Verbose output (-v) may interfere with JSON output (-J)

On the other hand it'd probably be good if iperf3 didn't do that.

bmah888 avatar Aug 02 '22 15:08 bmah888

Can't the debug output be outputted to STDERR to resolve this?

TheRealDJ avatar Nov 04 '22 16:11 TheRealDJ