log-timestamp
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -5,4 +5,4 @@ #!/usr/bin/env node | ||
require('../')('[%s] %s', function() { | ||
return new Date().toJSON(); | ||
return Date.now(); | ||
}); | ||
console.log('After log-timestamp'); |
@@ -22,3 +22,3 @@ var format = require('util').format; | ||
s = s || default_format; | ||
fn = fn || Date; | ||
fn = fn || default_function; | ||
Object.keys(funcs).forEach(function(k) { | ||
@@ -31,1 +31,6 @@ console[k] = function() { | ||
} | ||
// the default date format to print | ||
function default_function() { | ||
return new Date().toISOString(); | ||
} |
{ | ||
"name": "log-timestamp", | ||
"description": "Prepend timestamps to functions like console.log, console.warn, etc", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "Dave Eddy <dave@daveeddy.com> (http://www.daveeddy.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
@@ -19,3 +19,3 @@ log-timestamp | ||
Before log-timestamp | ||
[Thu Aug 23 2012 13:08:32 GMT-0700 (PDT)] After log-timestamp | ||
[2012-08-23T20:08:32.000Z] After log-timestamp | ||
``` | ||
@@ -33,10 +33,10 @@ | ||
``` | ||
date="Wed Oct 17 2012 13:35:02 GMT-0700 (PDT)" message="hello world" | ||
date="2012-08-23T20:08:37.000Z" message="hello world" | ||
``` | ||
Get fancy and pass in a function to call instead of `Date()` | ||
Get fancy and pass in a function to call instead of `new Date().toISOString()` | ||
``` js | ||
require('log-timestamp')('[%s] %s', function() { | ||
return new Date().toJSON(); | ||
return Date.now(); | ||
}); | ||
@@ -49,3 +49,3 @@ console.log('hello world'); | ||
``` | ||
[2012-10-17T20:42:18.608Z] hello world | ||
[1345752562432] hello world | ||
``` | ||
@@ -52,0 +52,0 @@ |
#!/usr/bin/env node | ||
require('../')('<<%s>> %s', function() { | ||
return new Date().toJSON(); | ||
return Date.now(); | ||
}); | ||
@@ -6,0 +6,0 @@ |
#!/usr/bin/env node | ||
require('../')(function() { | ||
return new Date().toJSON(); | ||
return Date.now(); | ||
}); | ||
@@ -6,0 +6,0 @@ |
3540
72