Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prepend timestamps to functions like console.log, console.warn, etc

Notifications You must be signed in to change notification settings

blackland1954/node-log-timestamp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log-timestamp

Prepend timestamps to functions like console.log, console.warn, etc

Example

console.log('Before log-timestamp');
require('log-timestamp');
console.log('After log-timestamp');

yields

Before log-timestamp
[2012-08-23T20:08:32.000Z] After log-timestamp

You can specify a custom function as well

require('log-timestamp')(function() { 'date="' + Date.now() + '" message="%s"');
console.log('hello %s', 'world');

yields

date="2012-08-23T20:08:37.000Z" message="hello world"

Install

npm install log-timestamp

Tests

npm test

License

MIT License

About

Prepend timestamps to functions like console.log, console.warn, etc

Resources

Stars

Watchers

Forks

Packages

No packages published