Add a convenient way to get logs of a path/drv. Requested by phreedom.

This commit is contained in:
Rob Vermaas 2014-02-19 10:21:59 +00:00
parent 73a0cb57c5
commit 6327edd63f

View file

@ -349,5 +349,18 @@ sub search :Local Args(0) {
}
sub log :Local :Args(1) {
my ($self, $c, $path) = @_;
$path = ($ENV{NIX_STORE_DIR} || "/nix/store")."/$path";
my @outpaths = ($path);
my $logPath = findLog($c, $path, @outpaths);
notFound($c, "The build log of $path is not available.") unless defined $logPath;
$c->stash->{'plain'} = { data => (scalar logContents($logPath)) || " " };
$c->forward('Hydra::View::Plain');
}
1;