Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support simplified output for logging #2940

Closed
3 tasks done
toonn opened this issue Sep 22, 2022 · 4 comments
Closed
3 tasks done

Support simplified output for logging #2940

toonn opened this issue Sep 22, 2022 · 4 comments

Comments

@toonn
Copy link

toonn commented Sep 22, 2022

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

When logging output to a file the throbber isn't overwritten but appended:

⠋ Compiling Main Process Code⠙ Preparing to Package Application for arch: x64⠙ Compiling Main Process Code⠹ Preparing to Package Application for arch: x64⠹ Compiling Main Process Code⠸ Preparing to Package Application for arch: x64⠸ Compili
ng Main Process Code⠼ Preparing to Package Application for arch: x64⠼ Compiling Main Process Code⠴ Preparing to Package Application for arch: x64⠴ Compiling Mai
n Process Code⠦ Preparing to Package Application for arch: x64⠦ Compiling Main Process Code⠧ Preparing to Package Application for arch: x64⠧ Compiling Main Proc
ess Code⠇ Preparing to Package Application for arch: x64⠇ Compiling Main Process Code⠏ Preparing to Package Application for arch: x64⠏ Compiling Main Process Co
de⠋ Preparing to Package Application for arch: x64⠋ Compiling Main Process Code⠙ Preparing to Package Application for arch: x64⠙ Compiling Main Process Code⠹ Preparing to Package Application for arch: x64⠹ Compiling Main Process Code⠸ Preparing to Package Application for arch: x64⠸ Compiling Main Process Code⠼ Preparin
g to Package Application for arch: x64⠼ Compiling Main Process Code⠴ Preparing to Package Application for arch: x64⠴ Compiling Main Process Code⠦ Preparing to P
ackage Application for arch: x64⠦ Compiling Main Process Code⠧ Preparing to Package Application for arch: x64⠧ Compiling Main Process Code⠇ Preparing to Package
 Application for arch: x64

Proposed solution

Provide a flag that suppresses the throbber animation.

Alternatives considered

Many command line utilities try to detect whether they're writing to a TTY to toggle behavior automatically. Like how ls suppresses coloring when you pipe to less. Ideally there would still be a way to force output format when you want to.

Additional information

No response

@erickzhao
Copy link
Member

Many command line utilities try to detect whether they're writing to a TTY to toggle behavior automatically.

The ora docs mention that this should happen automatically 🤔

If [the isEnabled flag] is not specified, the spinner will be enabled if the stream is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.

We don't use that flag in Forge's code, either.

@toonn
Copy link
Author

toonn commented Oct 8, 2022

Could it be due to the ora version? The yarn.lock has ora versions 5.x and 6.0.0.

@erickzhao
Copy link
Member

Update: we're currently in the process of replacing Ora with listr2 as well. Not sure what the implications are for this issue but we'll revisit!

@MarshallOfSound
Copy link
Member

Piping listr2 output to a file works as expected, closing this out as we've already landed listr2 support for start/init and package et. al is on the way in #3043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants