electrode-native
electrode-native copied to clipboard
`ern` command output noisy on CI/CD pipelines
When running any ern
command in a CI/CD environment, the default "KaxAdvancedRenderer" (fancy logging output with spinners and such) is used. This results in very long job outputs, since that renderer is designed for interactive terminals. It would be nice if the ern
command would switch to using the "KaxSimpleRenderer" if it detected a CI/CD environment (typically through the existence of the CI
environment variable)
This is a great suggestion, thanks @ryanliljestrom - We'll definitely look into it.
@ryanliljestrom
Sorry for late answer, but I'm not sure all CI environments are setting such an environment variable.
What we are doing on our CI is actually setting trace
log level for ern.
This log level will log much more than the default one (info
), but we like having a much data as possible in case something goes wrong on CI. In addition, this log level (as well as debug
one which is a little bit less verbose than trace
) will automatically use the simple renderer, playing well with CI.
You can enable trace
or debug
log level in different ways :
- Globally by running
ern platform config set logLevel trace
. Allern
commands run after this command will usetrace
log level OR - Globally by setting the
ERN_LOG_LEVEL
env var totrace
OR - Only for a specific
ern
command run by prepending the env var to the commandERN_LOG_LEVEL=trace ern [command]
What we could potentially consider is adding support for generic TERM
env variable (if not already the case). When that is set to TERM=dumb
it means that the output console has no capabilities at all (other than rendering plain text), so it should avoid fancy colors/spinners etc.