]> git.r.bdr.sh - rbdr/cologne/blame_incremental - lib/formatters/ansi.js
string.color was returning undefined
[rbdr/cologne] / lib / formatters / ansi.js
... / ...
CommitLineData
1if (typeof require === 'function') {
2 require('colors');
3}
4
5Module(Cobalt.Formatter, 'Ansi')({
6 format : function (logObject, opts){
7 var indent,
8 message;
9
10 indent = Array(logObject._indentLevel + 1).join(' ');
11
12 message = indent + logObject.message;
13
14 switch(logObject._level) {
15 case 0:
16 case 1:
17 case 2:
18 case 3:
19 return message.red;
20 case 4:
21 return message.yellow;
22 case 5:
23 case 6:
24 return message.blue;
25 default:
26 return message;
27 }
28 }
29});