From 9aecb1be2b89843c66852ad11ba6c22ef10d2e64 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 21 Sep 2015 15:10:23 +0100 Subject: [PATCH] formula: increase fail log lines, allow config. The default is almost never useful. 15 seems like a good medium as it'll not fill a 80x24 default but provides a bit more context. Also allow it to be overriden for developers and `test-bot`. --- Library/Homebrew/formula.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 36eb41b5ac..3e7e24d431 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1304,8 +1304,14 @@ class Formula $stdout.flush unless $?.success? + log_lines = ENV["HOMEBREW_FAIL_LOG_LINES"] + log_lines ||= "15" + log.flush - Kernel.system "/usr/bin/tail", "-n", "5", logfn unless verbose + unless verbose + puts "Last #{log_lines} lines from #{logfn}:" + Kernel.system "/usr/bin/tail", "-n", log_lines, logfn + end log.puts require "cmd/config"