turbo
turbo copied to clipboard
Add `--grouped` flag to group log output
Describe the feature you'd like to request
Output of steps are intermingled and can be a little hard to read

https://twitter.com/yangshunz/status/1470019087669489665
Describe the solution you'd like
- [ ] Add a
--grouped
flag that will not stream, but buffer and print all logs of a task once in a single group after a task is completed. This should be the default log behavior in non-interactive terminal processes. Ourlogstreamer
abstraction already has an option for this, but need to make sure that prints to stdout/stderr are not intermingled. Ideally, writes should print First In, First Out, so a (new) queue/channel might be needed inside ofrun_state.go
. - [ ] Update documentation
Describe alternatives you've considered
-
--buffered
flag name
Could this be enabled selectively?
For example, I may wish to only group the build
tasks but stream the dev
ones? That way if dev
depends on build
, it will initially group the build
logs but then switch to streaming for the dev
tasks.
@jaredpalmer is this taken up? If not I'd love to take this up. Any guidance would be awesome
Would love this. Our CI log is almost useless.
+1 could really use this for test output
I'll try check this on the weekend
We have the same problem in a bigger project (turbo.json n around 300 lines and 25 package.json in the mono repo). It's always a bit hard to find something in the log :-)
This feature would be really helpful for us ❤️
It also would be cool, if in that case, an additional parameter would toggle turbo to output GitHub Workflow Group statements for every task.
::group::{project name}:{task name}
::endgroup::
(see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines)
Alternatively, turbo could check if it's run in a GitHub Workflow via existence of GITHUB_
environment variables and do the grouping by default.
Couple naming options that have been floated internally:
-
--log-stream: natural | grouped
-
--log-order: stream | grouped
The --log-*
prefix feels like a good fit after --log-prefix
lands.
(cc @rafaeltab if you're interested in picking this up, let me know and I can help you get it merged. You can pick either of the names and we can change it once we get consensus here / internally)
@robaca, we're interested in handling the Github log grouping you mentioned after prefixing and grouping options land independently. The idea would be to compose both to make it Just Work in Github.
How can i contribute to this issue I am just a begineer?
@DivvSaxena Hey! I am working on this issue, and while not at a massive pace I am getting close to finishing it. I assume you got here because of the 'good first issue' tag, which is way underused.
If you still want to contribute to Turborepo, possibly through a different issue keep reading.
If you join the discord, perhaps someone can point you to a different issue you could pick up. If you mention me there, I'll try to get you in contact with someone who could point you in the right direction.
If you don't have discord or are unable to join the discord server for some other reason please let me know, and I'll try to get someone looking at this.
This was merged in #3916, thanks @rafaeltab!