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

add pipe scripts for slack logging #31769

Merged
merged 1 commit into from Nov 12, 2019
Merged

add pipe scripts for slack logging #31769

merged 1 commit into from Nov 12, 2019

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Nov 7, 2019

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 and stderr appropriately. For example, say we have a script like example.rb:

$stdout.puts "stdout"
$stderr.puts "stderr"

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:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms requested a review from a team November 7, 2019 22:32
@Hamms
Copy link
Contributor Author

Hamms commented Nov 8, 2019

we could also do something like ruby example.rb > >(slack_log) 2> >(slack_error) to split the output appropriately; it's not clear to me what the relative advantages and disadvantages are of that vs the pipe approach

@joshlory joshlory requested a review from daynew November 11, 2019 22:59
@Hamms Hamms merged commit a24402d into staging Nov 12, 2019
@Hamms Hamms deleted the i18n-slack-logging branch November 12, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants