Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-log-prefix
Prefix calls to console.log, console.warn, etc with whatever you'd like
https://github.com/bahamas10/node-log-prefix
Last synced: about 2 months ago
JSON representation
Prefix calls to console.log, console.warn, etc with whatever you'd like
- Host: GitHub
- URL: https://github.com/bahamas10/node-log-prefix
- Owner: bahamas10
- Created: 2013-06-18T19:18:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T17:41:32.000Z (over 6 years ago)
- Last Synced: 2024-10-13T02:38:15.678Z (2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 10
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
log-prefix
==========Prefix calls to console.log, console.warn, etc with whatever you'd like
Example
-------``` js
console.log('before log-prefix');
require('log-prefix')('==> %s <==');
console.log('after log-prefix');
```yields
```
before log-prefix
==> after log-prefix <==
```You can specify a function instead of a string. The function must return a
string to be used (good for dynamic values).``` js
require('log-prefix')(function() { return '[' + Date.now() + '] %s' });
console.log('hello %s', 'world');
```yields
```
[1371582989993] hello world
```Install
------npm install log-prefix
Tests
-----npm test
License
-------MIT License