diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index e21128f5..e6cddeb4 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -65,7 +65,7 @@ sub showLog { notFound($c, "Log file $path no longer exists.") unless -f $path; - if ($mode eq "") { + if (!$mode) { # !!! quick hack my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path") . " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -" @@ -79,6 +79,11 @@ sub showLog { $c->serve_static_file($path); } + elsif ($mode eq "tail") { + $c->stash->{'plain'} = { data => scalar `tail -n 50 $path` }; + $c->forward('Hydra::View::Plain'); + } + else { error($c, "Unknown log display mode `$mode'."); } diff --git a/src/lib/Hydra/View/Plain.pm b/src/lib/Hydra/View/Plain.pm new file mode 100644 index 00000000..d6f7ea92 --- /dev/null +++ b/src/lib/Hydra/View/Plain.pm @@ -0,0 +1,7 @@ +package Hydra::View::Plain; + +use strict; +use warnings; +use base 'Catalyst::View::Download::Plain'; + +1; diff --git a/src/root/build.tt b/src/root/build.tt index 8b5b6e9e..06fdf7b7 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -163,7 +163,8 @@ Logfile: Available - (raw) + (raw, + tail) [% END %] @@ -274,7 +275,7 @@ Failed: [% HTML.escape(step.errormsg) %] [% END %] [% IF step.logfile %] - (log, raw) + (log, raw, tail) [% END %] diff --git a/src/script/hydra_scheduler.pl b/src/script/hydra_scheduler.pl index 27b303f3..9ac6fd68 100755 --- a/src/script/hydra_scheduler.pl +++ b/src/script/hydra_scheduler.pl @@ -368,7 +368,7 @@ sub checkJobSet { # Store the errors messages for jobs that failed to evaluate. my $msg = ""; foreach my $error (@{$jobs->{error}}) { - $msg .= "at `" . $error->{location} . "': " . $error->{msg} . "\n"; + $msg .= "at `" . $error->{location} . "': " . $error->{msg} . "\n\n"; } setJobsetError($jobset, $msg); }