* Option to show the tail of a log.
This commit is contained in:
parent
54475b9266
commit
a6e84d8431
|
@ -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'.");
|
||||
}
|
||||
|
|
7
src/lib/Hydra/View/Plain.pm
Normal file
7
src/lib/Hydra/View/Plain.pm
Normal file
|
@ -0,0 +1,7 @@
|
|||
package Hydra::View::Plain;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use base 'Catalyst::View::Download::Plain';
|
||||
|
||||
1;
|
|
@ -163,7 +163,8 @@
|
|||
<th>Logfile:</th>
|
||||
<td>
|
||||
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
|
||||
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>)
|
||||
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
|
||||
<a href="[% c.uri_for('/build' build.id 'log' 'tail') %]">tail</a>)
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
|
@ -274,7 +275,7 @@
|
|||
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
||||
[% END %]
|
||||
[% IF step.logfile %]
|
||||
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>)
|
||||
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail" %]">tail</a>)
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue