aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-09-05 01:06:19 -0500
committerJack Nagel2014-09-05 01:22:01 -0500
commitab794c67e355ed045e2c250045fa7e7022c80ed0 (patch)
treea3ac37ea5da4aa0661c69b12309c78b4fbc9cf3d /Library/Homebrew
parent90a4e60c4bb4baca63bfa71beab46cd1f3d15203 (diff)
downloadhomebrew-ab794c67e355ed045e2c250045fa7e7022c80ed0.tar.bz2
Make logging cheaper in the non-verbose case
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index ab8bbd538..2277d3d7e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -538,9 +538,16 @@ class Formula
File.open(logfn, 'w') do |f|
f.puts Time.now, "", cmd, args, ""
- while buf = rd.gets
- f.puts buf
- puts buf if ARGV.verbose?
+ if ARGV.verbose?
+ while buf = rd.gets
+ f.puts buf
+ puts buf
+ end
+ elsif IO.respond_to?(:copy_stream)
+ IO.copy_stream(rd, f)
+ else
+ buf = ""
+ f.write(buf) while rd.read(1024, buf)
end
Process.wait(pid)