Docz: Build log is too long in CI

Created on 22 Jan 2019  ·  3Comments  ·  Source: doczjs/docz

Hi @pedronauck 👋!

Bug Report

Describe the bug

Before upgrading from docz 0.11 to 0.13, stdout in build logs was pretty concise:
screenshot 2019-01-22 at 15 51 46

And now they are nearly endless, because a new line is appended to stdout every fraction of a second
screenshot 2019-01-22 at 15 48 11

To Reproduce

Build docz in a non-tty environment (e.g. in CI)

Expected behavior

I'd expect no animation when printing out ⠏ Creating production build, which only works in TTY

Environment

  • OS: Linux VM in Azure Pipelines

Hint

if (process.stdout.isTTY) {
  // animated output (erasing and restoring the current line's output is supported)
} else {
  // plain console output (can't erase what's already been printed)
}

Most helpful comment

Hi most CI has process.env.CI = true what about using this env variable for disabling progress print?

All 3 comments

Looks like relying on process.stdout.isTTY is not enough – it's true in some CIs, which is misleading. There'll be a need for a custom isTTY() function similar to one here: https://github.com/prettier/prettier/pull/5804

Hi most CI has process.env.CI = true what about using this env variable for disabling progress print?

I'd recommend copy-pasting Prettier's isTTY() function. Neither process.env.CI nor process.stdout.isTTY provide a sufficient check for all real-life scenarios.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicholasess picture nicholasess  ·  3Comments

mariusespejo picture mariusespejo  ·  3Comments

mquandalle picture mquandalle  ·  3Comments

fenbka picture fenbka  ·  3Comments

w0wka91 picture w0wka91  ·  3Comments