add pipe scripts for slack logging #31769
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a couple of scripts that we will be able to use to log the results of the i18n sync to slack. Specifically, each script will pipe any given stdin stream directly to the slack channel appropriate to the environment in which it is being used; one script will display input normally, the other will display input as an error.
This means we can combine these scripts to report both
stdout
andstderr
appropriately. For example, say we have a script likeexample.rb
:We can run this script like
ruby example.rb | slack_log
to pipe just stdout to slack, or like(ruby example.rb | slack_log) |& slack_error
to pipe stdout to slack regularly, and stderr to slack as an error.Reviewer Checklist: