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

fix(mason_logger): Don't print the spinner when output is not a tty #527

Closed
bartekpacia opened this issue Sep 29, 2022 · 1 comment · Fixed by #582
Closed

fix(mason_logger): Don't print the spinner when output is not a tty #527

bartekpacia opened this issue Sep 29, 2022 · 1 comment · Fixed by #582
Assignees
Labels
bug Something isn't working

Comments

@bartekpacia
Copy link

bartekpacia commented Sep 29, 2022

This is a revival od #385.

Let's say that I have the following method:

Future<void> _installServer({
  required String device,
  required bool debug,
}) async {
  final progress = log.progress('Installing server');
  try {
    await _forceInstallApk(
      path: _artifactsRepository.serverArtifactPath,
      device: device,
      packageName: _serverPackage,
    );
  } catch (err) {
    progress.fail('Failed to install server');
    rethrow;
  }
  progress.complete('Installed server');
}

Locally, it works fine, but when run on GitHub Actions (so a non-interactive shell), the output is pretty horrible:

Screenshot 2022-09-20 at 11 25 04 PM

I suggest mason_logger take the same approach as the pub tool takes – don't print the spinner when the process' output is not a tty. See relevant code.

@bartekpacia bartekpacia added the bug Something isn't working label Sep 29, 2022
@bartekpacia bartekpacia changed the title fix(mason_logger): Allow for printing when Progress is running fix(mason_logger): Handle printing other logs when Progress is spinning Sep 29, 2022
@bartekpacia bartekpacia changed the title fix(mason_logger): Handle printing other logs when Progress is spinning fix(mason_logger): Don't print the spinner when output is not a tty Oct 15, 2022
@bartekpacia
Copy link
Author

This got better after merging #549:

Screenshot 2022-10-26 at 1 21 13 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants