@x1-labs/logging-express 0.1.6 → 0.1.8
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/dist/express.js +3 -4
- package/dist/express.js.map +1 -1
- package/package.json +2 -2
package/dist/express.js
CHANGED
|
@@ -8,7 +8,8 @@ const pino_http_1 = __importDefault(require("pino-http"));
|
|
|
8
8
|
const logging_1 = require("@x1-labs/logging");
|
|
9
9
|
function createExpressLogger(options = {}) {
|
|
10
10
|
const level = (0, logging_1.resolveLogLevel)(options.level);
|
|
11
|
-
const
|
|
11
|
+
const format = (0, logging_1.resolveLogFormat)(options.format ?? options.json);
|
|
12
|
+
const transport = (0, logging_1.resolveTransport)(format);
|
|
12
13
|
const autoLogging = options.autoLogging ?? true;
|
|
13
14
|
const forwardedIp = options.forwardedIp ?? true;
|
|
14
15
|
const base = (0, logging_1.resolveBase)();
|
|
@@ -20,9 +21,7 @@ function createExpressLogger(options = {}) {
|
|
|
20
21
|
level: (label) => ({ level: label.toUpperCase() }),
|
|
21
22
|
},
|
|
22
23
|
...(options.name ? { name: options.name } : {}),
|
|
23
|
-
...(
|
|
24
|
-
? { transport: { target: 'pino-pretty', options: { singleLine: true } } }
|
|
25
|
-
: {}),
|
|
24
|
+
...(transport ? { transport } : {}),
|
|
26
25
|
...(forwardedIp
|
|
27
26
|
? {
|
|
28
27
|
customProps: (req) => ({
|
package/dist/express.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":";;;;;AAoBA,kDAkCC;AArDD,0DAAiC;AAEjC,8CAK0B;AAY1B,SAAgB,mBAAmB,CACjC,UAAsC,EAAE;IAExC,MAAM,KAAK,GAAG,IAAA,yBAAe,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,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,mBAAQ,EAAC,WAAW,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x1-labs/logging-express",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Express pino-http logging middleware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"check": "bun run lint && bun run typecheck && bun run format --check"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@x1-labs/logging": "^0.1.
|
|
27
|
+
"@x1-labs/logging": "^0.1.8"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"express": "^4.0.0 || ^5.0.0",
|