Created
December 23, 2013 10:54
-
-
Save ArthurHoaro/8095073 to your computer and use it in GitHub Desktop.
Bookmarklet to Highlight WARN / ERROR in Jenkins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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