Forgive me if I've overlooked some way to do this, but I don't think it's currently possible to have progress output to stdout in json format. Note that I'm not talking about the --use-json-log option which affects the log file.
The use case is important if we are spawning rclone as a node.js child process, as this breaks the ability to output a pretty formatted progress to stdout without reading and processing the data as it gets streamed from the child process. If the output was json we could use childprocess.stdout.on('data') to read the progress stats and use other node.js methods to inform the user of progress in a polished output.
There could be a separate option called something like --use-json-progress that would accomplish this, while also keeping the formatting of the progress output separate from log file options. In my case, I'd want the progress output to be json but the log file output to be normal text.
@ncw Do you mean to just not use the built-in file logger and instead use stats (which I believe writes to stderr)? I suppose that would work as I can then parse the stderr stream for the stats object and output everything else to a file.
The rc suggestion is good as well, though I think just parsing stderr will be a bit simpler for my particular use case.