ntlogger 2.9.0 → 2.9.1
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/package.json +9 -9
- package/transports/pino.js +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ntlogger",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "A Custom Ready-To-Go Logging Wrapper Built on Winston",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"custom logger",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"test": "jest"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sentry/node": "^10.
|
|
46
|
-
"mysql2": "^3.
|
|
47
|
-
"pg": "^8.
|
|
48
|
-
"winston": "^3.
|
|
45
|
+
"@sentry/node": "^10.34.0",
|
|
46
|
+
"mysql2": "^3.16.1",
|
|
47
|
+
"pg": "^8.17.1",
|
|
48
|
+
"winston": "^3.19.0",
|
|
49
49
|
"winston-transport": "^4.9.0"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"
|
|
52
|
+
"split2": "^4.2.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"pino": ">=8.0.0"
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@sentry/profiling-node": "^10.
|
|
64
|
-
"dotenv": "^17.2.
|
|
65
|
-
"jest": "^30.
|
|
63
|
+
"@sentry/profiling-node": "^10.38.0",
|
|
64
|
+
"dotenv": "^17.2.4",
|
|
65
|
+
"jest": "^30.3.0"
|
|
66
66
|
},
|
|
67
67
|
"overrides": {
|
|
68
68
|
"glob": "^11.1.0"
|
package/transports/pino.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const split = require('split2');
|
|
4
4
|
const colors = require('../lib/colors');
|
|
5
5
|
|
|
6
6
|
const levelColors = colors.console;
|
|
@@ -153,13 +153,16 @@ function formatLine(obj, opts = {}) {
|
|
|
153
153
|
* @param {Object} opts - Transport options
|
|
154
154
|
*/
|
|
155
155
|
module.exports = function (opts = {}) {
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
return split(function (line) {
|
|
157
|
+
let obj;
|
|
158
|
+
try {
|
|
159
|
+
obj = JSON.parse(line);
|
|
160
|
+
} catch {
|
|
159
161
|
process.stdout.write(line + '\n');
|
|
162
|
+
return;
|
|
160
163
|
}
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
const formatted = formatLine(obj, opts);
|
|
165
|
+
process.stdout.write(formatted + '\n');
|
|
163
166
|
});
|
|
164
167
|
};
|
|
165
168
|
|