Quantcast
Channel: Callum Macdonald » greasemonkey
Viewing all articles
Browse latest Browse all 3

Styling PaperTrail log output

$
0
0

We use papertrail to aggregate log data from our servers. Awesome tool. I wrote a simple GreaseMonkey script which highlights the names of our servers. Very easy to do. Could equally have built it in Stylish, but I already use GM, so that’s how it went. Here’s the code as per a request from Henry.

// ==UserScript==
// @name Papertrail styles
// @namespace http://www.callum-macdonald.com/code/
// @description Add some custom colours to our papertrail output
// @include https://papertrailapp.com/*events*
// @author Callum Macdonald
// @copyright 2012 by Callum Macdonald
// @license GPL v3+
// @version 0.1
// @lastupdated 2012-08-29
// @grant GM_addStyle
// ==/UserScript==

// Simply inject an extra style element
GM_addStyle("\
#event_list li[data-system='foo'] .system a { background-color: red; }\
#event_list li[data-system='bar'] .system a { background-color: blue; }\
#event_list li[data-system='ba1'] .system a { background-color: yellow; }\
#event_list li[data-system='ba2'] .system a { background-color: green; }\
#event_list li[data-system='ba3'] .system a { background-color: purple; }\
");


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images