@blocklet/logger 1.16.21-beta-445a8baa → 1.16.21-beta-2e75c75c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +7 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -4,5 +4,11 @@ if (!process.env.BLOCKLET_LOG_DIR) {
|
|
|
4
4
|
throw new Error('valid BLOCKLET_LOG_DIR env is required by logger');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} label
|
|
9
|
+
* @param {object} option
|
|
10
|
+
* @param {'emerg'|'alert'|'crit'|'error'|'warning'|'notice'|'info'|'debug'} [option.level] default is info
|
|
11
|
+
*/
|
|
12
|
+
module.exports = (label, { level } = {}) =>
|
|
13
|
+
logger(label, { logDir: process.env.BLOCKLET_LOG_DIR, filename: 'info', level: level || 'info' });
|
|
8
14
|
module.exports.getAccessLogStream = () => logger.getAccessLogStream(process.env.BLOCKLET_LOG_DIR);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/logger",
|
|
3
|
-
"version": "1.16.21-beta-
|
|
3
|
+
"version": "1.16.21-beta-2e75c75c",
|
|
4
4
|
"description": "A library to facilitate Blocklet logging",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"coverage": "npm run test -- --coverage"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@abtnode/logger": "1.16.21-beta-
|
|
33
|
+
"@abtnode/logger": "1.16.21-beta-2e75c75c"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"jest": "^27.5.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "1fca0b58e1ed4f7a9bb268829a7c84290a01c89d"
|
|
39
39
|
}
|