X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/blobdiff_plain/73ca23120543f14672a960bb343db2bee676620b..26b061b8b81f39ad11fbd9c6c761ec3e699dbad2:/lib/cobalt.js diff --git a/lib/cobalt.js b/lib/cobalt.js index d2d2c13..fa4f623 100644 --- a/lib/cobalt.js +++ b/lib/cobalt.js @@ -93,22 +93,39 @@ buildLog : function (item, level) { var co = this, oldItem, logObject = {}; - if (!item._cobaltLog) { + if (typeof item === "undefined" || item === null || !item._cobaltLog) { logObject.message = item; logObject._cobaltLog = true; logObject._from = co.from; - logObject._level = item._level || level || 7; - logObject._levelString = co._levelString(item._level); + logObject._level = level || 6; + logObject._levelString = co._levelString(logObject._level); logObject._version = co.version; logObject._timestamp = co.now(); logObject._indentLevel = co.currentIndent; logObject._color = co.currentColor; + logObject._separator = false; return logObject; } return item; }, + extendLog : function (extendingObject) { + var co = this, logObject, + property; + + logObject = co.buildLog(undefined, 6); + extendingObject = extendingObject || {}; + + for (property in extendingObject) { + if (extendingObject.hasOwnProperty(property)) { + logObject[property] = extendingObject[property]; + } + } + + return logObject; + }, + buildSeparator : function (type) { var co = this; return { @@ -142,23 +159,42 @@ }, log : function () { - this._log.apply(this, [7].concat([].splice.call(arguments, 0))); + this._log.apply(this, [6].concat(Array.prototype.slice.call(arguments))); + }, + + debug : function () { + this._log.apply(this, [7].concat(Array.prototype.slice.call(arguments))); }, info : function () { - this._log.apply(this, [6].concat([].splice.call(arguments, 0))); + this._log.apply(this, [6].concat(Array.prototype.slice.call(arguments))); }, notice : function () { - this._log.apply(this, [5].concat([].splice.call(arguments, 0))); + this._log.apply(this, [5].concat(Array.prototype.slice.call(arguments))); }, warn : function () { - this._log.apply(this, [4].concat([].splice.call(arguments, 0))); + this._log.apply(this, [4].concat(Array.prototype.slice.call(arguments))); }, error : function () { - this._log.apply(this, [3].concat([].splice.call(arguments, 0))); + this._log.apply(this, [3].concat(Array.prototype.slice.call(arguments))); + }, + + dir : function () { + }, + + time : function () { + }, + + timeEnd : function () { + }, + + groupCollapsed : function () { + }, + + groupEnd : function () { }, separator : function (type) {