electrode-native icon indicating copy to clipboard operation
electrode-native copied to clipboard

`ern` command output noisy on CI/CD pipelines

Open ryanliljestrom opened this issue 5 years ago • 3 comments

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)

ryanliljestrom avatar Jan 21 '20 21:01 ryanliljestrom

This is a great suggestion, thanks @ryanliljestrom - We'll definitely look into it.

friederbluemle avatar Jan 23 '20 19:01 friederbluemle

@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 :

  1. Globally by running ern platform config set logLevel trace. All ern commands run after this command will use trace log level OR
  2. Globally by setting the ERN_LOG_LEVEL env var to trace OR
  3. Only for a specific ern command run by prepending the env var to the command ERN_LOG_LEVEL=trace ern [command]

belemaire avatar Jan 31 '20 22:01 belemaire

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.

friederbluemle avatar Feb 01 '20 00:02 friederbluemle