X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/blobdiff_plain/bdedb5e54032363de8afa322fadae0e2cb2132d0..54a5290bbcae03d129dd21401a4dae98d0aef775:/lib/formatters/simple.js?ds=sidebyside diff --git a/lib/formatters/simple.js b/lib/formatters/simple.js index 24f65b3..9eb6bbe 100644 --- a/lib/formatters/simple.js +++ b/lib/formatters/simple.js @@ -1,30 +1,11 @@ -(function (global) { - var Module; - - // Load up dependencies - if (typeof require === 'function') { - var Ne = require('neon'); - Module = Ne.Module; - } else { - Module = global.Module; - } - - var Cobalt = {}; - Module(Cobalt, 'Formatter')({}); - - Cobalt.Formatter.Simple = Module(Cobalt.Formatter, 'Simple')({ +Module(Cobalt.Formatter, 'Simple')({ format : function (logObject, opts){ - var indent; + var indent, date; - indent = Array(logObject._indentLevel + 1).join(' '); + indent = Array(logObject._indentLevel + 1).join(' '); - return indent + logObject.message; - } - }); + date = new Date(logObject._timestamp); - if (typeof require === 'function') { - global.Simple = Cobalt.Formatter.Simple; - } else { - global.Cobalt.Formatter.Simple = Cobalt.Formatter.Simple; - } -}(typeof window !== 'undefined' ? window : (typeof exports !== 'undefined' ? exports : self))); + return indent + '[' + date.toISOString() + '][' + logObject._levelString + '] ' + logObject._from + ' : ' + logObject.message; + } +});