0.5.2 • Published 10 years ago

logstamp v0.5.2

Weekly downloads
45
License
-
Repository
github
Last release
10 years ago

logstamp Build Status

Overrides the console's stdout and stderr streams to prefix each log message with a stamp. Similar to https://github.com/bahamas10/node-log-timestamp but console methods are untouched, so things like console.log's application of util.format still work.

Examples

console.log('Object: %s', 'myRobot', {number: 5});
require('logstamp')();
console.log('Object: %s', 'myRobot', {number: 5});

Output:

Object: myRobot { number: 5 }
2013-08-17T21:37:16.212Z Object: myRobot { number: 5 }

If desired, a custom stamp can also be set:

require('logstamp')(function () {
  return Date.now() + ' Server X ';
});
console.log([1, 2, 3]);

Output:

1378137011853 Server X [ 1, 2, 3 ]
0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago