]> git.r.bdr.sh - rbdr/cologne/blob - lib/formatters/simple.js
Properly handle logging null.
[rbdr/cologne] / lib / formatters / simple.js
1 (function (global) {
2 var Module;
3
4 // Load up dependencies
5 if (typeof require === 'function') {
6 var Ne = require('neon');
7 Module = Ne.Module;
8 } else {
9 Module = global.Module;
10 }
11
12 var Cobalt = {};
13 Module(Cobalt, 'Formatter')({});
14
15 Cobalt.Formatter.Simple = Module(Cobalt.Formatter, 'Simple')({
16 format : function (logObject, opts){
17 var indent;
18
19 indent = Array(logObject._indentLevel + 1).join(' ');
20
21 return indent + logObject.message;
22 }
23 });
24
25 if (typeof require === 'function') {
26 global.Simple = Cobalt.Formatter.Simple;
27 } else {
28 global.Cobalt.Formatter.Simple = Cobalt.Formatter.Simple;
29 }
30 }(typeof window !== 'undefined' ? window : (typeof exports !== 'undefined' ? exports : self)));