Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Always capture command output and report package name #442

Merged
merged 1 commit into from
Nov 9, 2015

Conversation

davecheney
Copy link
Contributor

Fixes #440

Prior to #437 the name of the package under compile or test would be
printed before the operation started. This was a problem, because the
compilation output could occur later, and not line up with the package
name.

After #437, package name output was surpressed until the compile/test
action completed successfully. This helped improve the output for tests
but as the overall action, the print would never occur, only the output
to stdout from the child process.

This PR solves the problem at the source by delegating the responsibility
for printing the name of the package before any child output. If all
actions complete, then the final action in the set will print the name
of the package.

As it is now unused, context.run has been removed.

TODO:

  • decide if the output should go to stderr, not stdout
  • decide if we should include a # prefix as the go tool does

Fixes #440

Prior to #437 the name of the package under compile or test would be
printed *before* the operation started. This was a problem, because the
compilation output could occur later, and not line up with the package
name.

After #437, package name output was surpressed until the compile/test
action completed successfully. This helped improve the output for tests
but as the overall action, the print would never occur, only the output
to stdout from the child process.

This PR solves the problem at the source by delegating the responsibility
for printing the name of the package before any child output. If all
actions complete, then the final action in the set will print the name
of the package.

As it is now unused, `context.run` has been removed.

TODO:

- [ ] decide if the output should go to stderr, not stdout
- [ ] decide if we should include a # prefix as the go tool does
@davecheney
Copy link
Contributor Author

I've tested this change today and I'm going to commit this as is without addressing the TODO items.

I'll address the TODO items once 0.3.1 is cut.

davecheney added a commit that referenced this pull request Nov 9, 2015
Always capture command output and report package name
@davecheney davecheney merged commit 0c6c1bb into master Nov 9, 2015
@davecheney davecheney deleted the fixedbugs/440 branch November 9, 2015 05:10
davecheney added a commit that referenced this pull request Nov 9, 2015
The uses of gb/log are so simple now that there is no value in having
a log.Info wrapper around fmt.

At the same time, address the remaining TODO items on #442.

- [x] compile/test failures are now with a # prefix,  this matches the
      go tools observed behaviour.
- [x] failures go to os.Stderr, successes go to os.Stdout.

Finally, remove log.Quiet flag as there is no ERROR level, nor INFO level.
gb users should pipe the appropriate fd's to /dev/null to adjust the
verbosity level of cmd/gb.
@davecheney davecheney mentioned this pull request Nov 9, 2015
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

output failing package before compile errors
1 participant