Skip to content

Instantly share code, notes, and snippets.

@ArthurHoaro
Created December 23, 2013 10:54
Show Gist options
  • Save ArthurHoaro/8095073 to your computer and use it in GitHub Desktop.
Save ArthurHoaro/8095073 to your computer and use it in GitHub Desktop.
Bookmarklet to Highlight WARN / ERROR in Jenkins
javascript:{var elems = document.getElementsByTagName('pre'), i, j;
for (i in elems) {
if(elems[i].id.indexOf("out") == -1) {
var lines = elems[i].innerHTML.split("\n");
var out = "";
for( j in lines ) {
if(lines[j].length > 0 && (""+lines[j]).indexOf("[ERROR]") > 0) {
lines[j] = "<span style=\"background-color:red;color:white\">" + lines[j] + "</span>";
}
else if(lines[j].length > 0 && (""+lines[j]).indexOf("[WARN]") > 0) {
lines[j] = "<span style=\"background-color:yellow;\">" + lines[j] + "</span>";
}
out += lines[j] + "\n";
}
elems[i].innerHTML = out;
}
};void(0);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment