honeybadger-ruby
honeybadger-ruby copied to clipboard
honeybadger exec --no-quiet has no effect?
I may be misunderstanding the documentation, but it seems that the --no-quiet
flag on honeybadger exec
should prevent STDOUT and STDERR from being swallowed.
However, running:
honeybadger exec --no-quiet echo 'hi'
Results in nothing being printed to STDOUT. I'm using the most recent edge version of the gem: Commit 35bdf07579163b24ded6b76e0bb675d45239a26d
@starrhorne --no-quiet
is the default behavior and the opposite of --quiet
, which may not do what you think it does. honeybadger exec
does not print to stdout by default. Instead it executes the command, capturing all output streams. If the command exits with a non-zero code or it has stderr output, then honeybadger exec
dumps all the output (with an error message) to stdout. If the command exits successfully with no stderr output, then honeybadger exec
exits silently. That's to prevent unwanted emails from cron (which are normally sent if there is any output, even for successful tasks).
The --quiet
option silences all output, including stderr unless the command errors and the notification to Honeybadger fails, for instance due to a connection error. The --quiet
option allows cron's email feature to be used as a backup, since if the command fails all the output would be dumped and cron would send an email. Otherwise one can assume that the command is either executed successfully or Honeybadger has been notified.
Thanks for the explanation!
I guess I was expecting there to be a flag that would allow STDOUT and STDERR to pass through the honeybadger exec
command in case you needed to capture them for some other purpose, or in case you like the default cron email behavior. That’s just my assumption though. Perhaps it’s a non-issue in real-world usage.
Closing due to lack of activity