[cli] Generator logs to STDOUT when debug options are set
Created by: devplayer0
Description
Since #207, log messages are written to STDOUT and STDERR respectively based on the level of the message, which makes sense.
However, when debugging the models / operations passed to the templates, it would be nice to be able to pipe the JSON directly into a file / program which could parse it directly. Currently the piped output will include any of the messages written to STDOUT (which is everything except for errors), which means that it is unparsable.
openapi-generator version
Latest from master
OpenAPI declaration file content or url
N/A
Command line used for generation
java -DdebugModels -jar openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i cellar.json -o /tmp/cellar > generate.json
Steps to reproduce
Pipe the output of any generate
command with a debug flag set (such as debugModels
or debugOperations
)
Related issues/PRs
This is in direct response to #207.
Suggest a fix/enhancement
See PR #474