Remove the pretty-printed log

It didn't work anymore due to the removal of nix-log2xml. And in any
case XSL is the work of the devil.
This commit is contained in:
Eelco Dolstra 2016-10-27 14:43:17 +02:00
parent 41a020e323
commit 2b790ceefa
11 changed files with 9 additions and 183 deletions

View file

@ -74,7 +74,6 @@ AC_CONFIG_FILES([
src/hydra-eval-jobs/Makefile src/hydra-eval-jobs/Makefile
src/hydra-queue-runner/Makefile src/hydra-queue-runner/Makefile
src/sql/Makefile src/sql/Makefile
src/xsl/Makefile
src/ttf/Makefile src/ttf/Makefile
src/lib/Makefile src/lib/Makefile
src/root/Makefile src/root/Makefile

View file

@ -135,7 +135,7 @@ rec {
]; ];
hydraPath = lib.makeBinPath ( hydraPath = lib.makeBinPath (
[ libxslt sqlite subversion openssh nix coreutils findutils pixz [ sqlite subversion openssh nix coreutils findutils pixz
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] ); ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );

View file

@ -1,3 +1,3 @@
SUBDIRS = hydra-evaluator hydra-eval-jobs hydra-queue-runner sql script lib root xsl ttf SUBDIRS = hydra-evaluator hydra-eval-jobs hydra-queue-runner sql script lib root ttf
BOOTCLEAN_SUBDIRS = $(SUBDIRS) BOOTCLEAN_SUBDIRS = $(SUBDIRS)
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)

View file

@ -155,19 +155,14 @@ sub showLog {
|| $size < 64 * 1024 * 1024; || $size < 64 * 1024 * 1024;
if ($mode eq "pretty") { if ($mode eq "pretty") {
# !!! quick hack
my $pipeline = ($logPath =~ /.bz2$/ ? "bzip2 -d < $logPath" : "cat $logPath")
. " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -"
. " | xsltproc " . $c->path_to("xsl/log2html.xsl") . " -";
$c->stash->{template} = 'log.tt'; $c->stash->{template} = 'log.tt';
$c->stash->{logtext} = decode("utf-8", `ulimit -t 5 ; $pipeline`); $c->stash->{logtext} = logContents($logPath);
} }
elsif ($mode eq "raw") { elsif ($mode eq "raw") {
$c->stash->{logPath} = $logPath; $c->stash->{logPath} = $logPath;
$c->stash->{finished} = $finished; $c->stash->{finished} = $finished;
$c->forward('Hydra::View::NixLog'); $c->forward('Hydra::View::NixLog');
return;
} }
elsif ($mode eq "tail-reload") { elsif ($mode eq "tail-reload") {

View file

@ -8,10 +8,8 @@
[% END %] [% END %]
</p> </p>
<hr /> <pre class="taillog" id="contents">
[% HTML.escape(logtext) %]
<div class="buildlog"> </pre>
[% logtext %]
</div>
[% END %] [% END %]

View file

@ -1,11 +1,11 @@
[% WRAPPER layout.tt title=title %] [% WRAPPER layout.tt title="Log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job $build.project.name:$build.jobset.name:$build.job.name" %]
[% PROCESS common.tt %] [% PROCESS common.tt %]
[% project = build.project %] [% project = build.project %]
[% jobset = build.jobset %] [% jobset = build.jobset %]
[% job = build.job %] [% job = build.job %]
<h2>Last 50 log lines of [% INCLUDE renderFullJobNameOfBuild %] build <a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a>[%IF step %] step [% step.stepnr %][% END %]</h2> <p>Below are the last 50 log lines. The <a href="[% c.uri_for('/build' build.id 'log') %]">full log</a> is also available.</p>
[% IF reload %] [% IF reload %]
<script> <script>

View file

@ -119,10 +119,8 @@ span.keep-whitespace {
max-width: none; /* don't apply responsive design to status images */ max-width: none; /* don't apply responsive design to status images */
} }
pre.taillog { pre.log, pre.taillog {
line-height: 1.2em; line-height: 1.2em;
max-height: 60em;
overflow: hidden;
} }
div.flot-tooltip { div.flot-tooltip {

View file

@ -1,50 +0,0 @@
em.storeref {
color: #500000;
position: relative;
width: 100%;
}
em.storeref:hover {
background-color: #eeeeee;
}
*.popup {
display: none;
background: #ffffcd;
border: solid #555555 1px;
position: absolute;
top: 0em;
left: 0em;
margin: 0;
padding: 0;
z-index: 100;
}
em.storeref:hover span.popup {
display: inline;
width: 40em;
}
span.code {
white-space: pre-wrap;
font-family: monospace;
}
.errorLine {
color: #ff0000;
font-weight: bold;
}
.warningLine {
color: darkorange;
font-weight: bold;
}
.prio3 {
font-style: italic;
}
a.lineno {
color: #909090;
float: right;
}

View file

@ -1,4 +0,0 @@
EXTRA_DIST = log2html.xsl mark-errors.xsl
xsldir = $(libexecdir)/hydra/xsl
nobase_xsl_DATA = $(EXTRA_DIST)

View file

@ -1,81 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' encoding="UTF-8" omit-xml-declaration="yes" />
<xsl:template match="logfile">
<p>
<a href="javascript:" class="btn btn-info tree-expand-all"><i class="icon-plus icon-white"></i> Expand all</a>
<xsl:text> </xsl:text>
<a href="javascript:" class="btn btn-info tree-collapse-all"><i class="icon-minus icon-white"></i> Collapse all</a>
</p>
<ul class='tree'>
<xsl:for-each select='line|nest'>
<li>
<xsl:apply-templates select='.'/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="nest">
<!-- The tree should be collapsed by default if all children are
unimportant or if the header is unimportant. -->
<!-- <xsl:variable name="collapsed"
select="count(.//line[not(@priority = 3)]) = 0 or ./head[@priority = 3]" /> -->
<xsl:variable name="collapsed" select="count(.//*[@error]) = 0"/>
<xsl:variable name="style"><xsl:if test="$collapsed">display: none;</xsl:if></xsl:variable>
<xsl:variable name="arg"><xsl:choose><xsl:when test="$collapsed">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:variable>
<xsl:if test="line|nest">
<a href="javascript:" class="tree-toggle"></a>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select='head'/>
<!-- Be careful to only generate <ul>s if there are <li>s, otherwise its malformed. -->
<xsl:if test="line|nest">
<ul class='subtree' style="{$style}">
<xsl:for-each select='line|nest'>
<li>
<xsl:apply-templates select='.'/>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
<xsl:template match="head|line">
<xsl:variable name="lineno"><xsl:number count="head|line" level="any" /></xsl:variable>
<a class="lineno" href="#line-{$lineno}" id="line-{$lineno}"><xsl:value-of select="$lineno" /> </a>
<span class="code">
<xsl:if test="@error">
<xsl:attribute name="class">code errorLine</xsl:attribute>
</xsl:if>
<xsl:if test="@warning">
<xsl:attribute name="class">code warningLine</xsl:attribute>
</xsl:if>
<xsl:if test="@priority = 3">
<xsl:attribute name="class">code prio3</xsl:attribute>
</xsl:if>
<xsl:apply-templates/><br/>
</span>
</xsl:template>
<xsl:template match="storeref">
<em class='storeref'>
<span class='popup'><xsl:apply-templates/></span>
<span class='elided'>/...</span><xsl:apply-templates select='name'/><xsl:apply-templates select='path'/>
</em>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,29 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='xml' encoding="UTF-8" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="line">
<line>
<xsl:if test="contains(text(), ' *** ') or
contains(text(), 'LaTeX Error') or
contains(text(), 'BUILD FAILED') or
starts-with(text(), 'FAIL:') or
contains(text(), 'FAILURE') or
contains(text(), '[ERROR]') or
contains(text(), ' error: ') or
true">
<xsl:attribute name="error"></xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@*|node()"/>
</line>
</xsl:template>
</xsl:stylesheet>