diff --git a/CHANGES.md b/CHANGES.md index b55b26b..1d86474 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,8 @@ Known issues: ## bunyan 0.16.9 (not yet released) -(nothing yet) +- *Exit* on EPIPE, otherwise we sit there useless processing a huge log file + with, e.g. `bunyan huge.log | head`. ## bunyan 0.16.8 diff --git a/bin/bunyan b/bin/bunyan index 762e24c..47e045e 100755 --- a/bin/bunyan +++ b/bin/bunyan @@ -910,6 +910,7 @@ function emit(s) { process.stdout.on("error", function (err) { if (err.code === "EPIPE") { // Pass. See . + drainStdoutAndExit(0); } else { warn(err); drainStdoutAndExit(1);