Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix(console-sink): Include a timestamp when using the console sink.

  • Loading branch information...
commit 7e097aa458343a358ff69909de564c2e75991e24 1 parent 28b9df2
@jirwin jirwin authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/logmagic.js
View
6 lib/logmagic.js
@@ -247,14 +247,16 @@ exports.clearRewriter = function(func) {
/* This is just here for initial dev work, REMOVE ME */
exports.registerSink("console", function(modulename, level, message, obj) {
+ var timestamp = (new Date().getTime()) / 1000;
+
if (obj && Object.keys(obj).length !== 0) {
/* TODO: improve */
var fm = obj['full_message'] ? "\n " + obj['full_message'] : "";
obj['full_message'] = undefined;
- console.log(modulename +": "+ message + " " + JSON.stringify(obj) + fm);
+ console.log(modulename + " [" + timestamp + "]" + ": "+ message + " " + JSON.stringify(obj) + fm);
}
else {
- console.log(modulename +": "+ message);
+ console.log(modulename + " [" + timestamp + "]" + ": "+ message);
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.