Skip to content

Commit 58d611c

Browse files
committed
10.0.0
1 parent ba8309a commit 58d611c

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ logger.setDate(() => (new Date()).toLocaleTimeString())
178178
logger.info("This is an info message") // 5:17:59 pm [INFO] This is an info message
179179
```
180180

181+
### `createNamedLogger()`
182+
183+
You can named a logger by `createNamedLogger()`
184+
185+
```
186+
logger.createNamedLogger("Test 4");
187+
logger.error('error show'); // 2022-08-18T01:38:13.277Z [Test 4] [ERROR] error show
188+
```
189+
181190
### Log Files
182191

183192
If you want to save the logs to files, you can use shell pipes:

change.log.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
10.0.0
2+
- Adding error catching to json stringify
3+
- Adding support for named loggers: `createNamedLogger()`
4+
15
9.0.0
26
- modify `success()`
37

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "node-color-log",
3-
"version": "9.0.0",
3+
"version": "10.0.0",
44
"description": "The more powerful JavaScript logger for NodeJS and browsers.",
55
"main": "index.js",
66
"scripts": {
7-
"test": "node test.js && LOGGER=info node test2.js"
7+
"test": "node test.js && LOGGER=info node test2.js && node test3.js && LOGGER=info node test4.js"
88
},
99
"repository": {
1010
"type": "git",

test4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const logger = require('./index').createNamedLogger("Test 4");
22

3-
// $ LOGGER=info node test2.js
3+
// $ LOGGER=info node test4.js
44
logger.log('****************************************');
55
logger.log('*** Test Environment Variable LOGGER ***');
66
logger.log('****************************************');

0 commit comments

Comments
 (0)