]> git.r.bdr.sh - rbdr/cologne/blob - lib/formatters/ansi.js
806869ae8777afb34b465b25989079a570696c00
[rbdr/cologne] / lib / formatters / ansi.js
1 if (typeof require === 'function') {
2 require('colors');
3 }
4
5 Module(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 });