Link default log format to TTY
Currently, the default log format is only linked to the CI environment variable. If the CI environment variable is true (i.e., CI=true), the default log format is json. Otherwise, the default format is pretty. This has proven not to be a useful default. In fact,
Here's the logic I propose for the default value:
- If stdout is a TTY (interactive terminal) or CI=true, use pretty
- Otherwise, use json
Here's the reasoning behind these rules. If you're using Antora in a CI environment, you usually want to see the pretty log since the CI output itself is not structured. If you're using Antora locally, you want to see pretty output when you run it normally. If you pipe the output of Antora to a log processor such as jq
, then you want Antora to automatically switch to json output (assuming you have not set the log format). This is a very convenient default.
Of course, this is just a default. If you want a specific format, you can specify it using the playbook, a CLI option, or an environment variable.