@jaypie/express 1.0.12 → 1.0.13

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/module.cjs CHANGED
@@ -196,6 +196,11 @@ const expressHandler = (
196
196
  const libLogger = core.log.lib({
197
197
  lib: core.JAYPIE.LIB.EXPRESS,
198
198
  });
199
+ // Top-level, important details that run at the same level as the main logger
200
+ const log = core.log.lib({
201
+ level: core.log.level,
202
+ lib: core.JAYPIE.LIB.EXPRESS,
203
+ });
199
204
 
200
205
  // Update the public logger with the request ID
201
206
  const invokeUuid = getCurrentInvokeUuid();
@@ -205,15 +210,24 @@ const expressHandler = (
205
210
  // TODO: in theory this is redundant
206
211
  libLogger.tag({ invoke: invokeUuid });
207
212
  libLogger.tag({ shortInvoke: invokeUuid.slice(0, 8) });
213
+ log.tag({ invoke: invokeUuid });
214
+ log.tag({ shortInvoke: invokeUuid.slice(0, 8) });
208
215
  }
209
216
 
210
- libLogger.trace("[jaypie] Express init");
217
+ if (!name) {
218
+ // If handler has a name, use it
219
+ if (handler.name) {
220
+ name = handler.name;
221
+ } else {
222
+ name = core.JAYPIE.UNKNOWN;
223
+ }
224
+ }
225
+ core.log.tag({ handler: name });
226
+ // TODO: in theory this is redundant
227
+ libLogger.tag({ handler: name });
228
+ log.tag({ handler: name });
211
229
 
212
- // Top-level, important details that run at the same level as the main logger
213
- const log = core.log.lib({
214
- level: core.log.level,
215
- lib: core.JAYPIE.LIB.EXPRESS,
216
- });
230
+ libLogger.trace("[jaypie] Express init");
217
231
 
218
232
  // Set req.locals if it doesn't exist
219
233
  if (!req.locals) req.locals = {};
@@ -194,6 +194,11 @@ const expressHandler = (
194
194
  const libLogger = log.lib({
195
195
  lib: JAYPIE.LIB.EXPRESS,
196
196
  });
197
+ // Top-level, important details that run at the same level as the main logger
198
+ const log$1 = log.lib({
199
+ level: log.level,
200
+ lib: JAYPIE.LIB.EXPRESS,
201
+ });
197
202
 
198
203
  // Update the public logger with the request ID
199
204
  const invokeUuid = getCurrentInvokeUuid();
@@ -203,15 +208,24 @@ const expressHandler = (
203
208
  // TODO: in theory this is redundant
204
209
  libLogger.tag({ invoke: invokeUuid });
205
210
  libLogger.tag({ shortInvoke: invokeUuid.slice(0, 8) });
211
+ log$1.tag({ invoke: invokeUuid });
212
+ log$1.tag({ shortInvoke: invokeUuid.slice(0, 8) });
206
213
  }
207
214
 
208
- libLogger.trace("[jaypie] Express init");
215
+ if (!name) {
216
+ // If handler has a name, use it
217
+ if (handler.name) {
218
+ name = handler.name;
219
+ } else {
220
+ name = JAYPIE.UNKNOWN;
221
+ }
222
+ }
223
+ log.tag({ handler: name });
224
+ // TODO: in theory this is redundant
225
+ libLogger.tag({ handler: name });
226
+ log$1.tag({ handler: name });
209
227
 
210
- // Top-level, important details that run at the same level as the main logger
211
- const log$1 = log.lib({
212
- level: log.level,
213
- lib: JAYPIE.LIB.EXPRESS,
214
- });
228
+ libLogger.trace("[jaypie] Express init");
215
229
 
216
230
  // Set req.locals if it doesn't exist
217
231
  if (!req.locals) req.locals = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/express",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "author": "Finlayson Studio",
5
5
  "type": "module",
6
6
  "exports": {
@@ -45,7 +45,7 @@
45
45
  "@jaypie/core": "^1.0.41"
46
46
  },
47
47
  "devDependencies": {
48
- "@jaypie/testkit": "^1.0.19",
48
+ "@jaypie/testkit": "^1.0.20",
49
49
  "@rollup/plugin-commonjs": "^26.0.1",
50
50
  "@rollup/plugin-node-resolve": "^15.2.3",
51
51
  "eslint": "^8.57.0",
@@ -47,6 +47,11 @@ const expressHandler = (
47
47
  const libLogger = publicLogger.lib({
48
48
  lib: JAYPIE.LIB.EXPRESS,
49
49
  });
50
+ // Top-level, important details that run at the same level as the main logger
51
+ const log = publicLogger.lib({
52
+ level: publicLogger.level,
53
+ lib: JAYPIE.LIB.EXPRESS,
54
+ });
50
55
 
51
56
  // Update the public logger with the request ID
52
57
  const invokeUuid = getCurrentInvokeUuid();
@@ -56,15 +61,24 @@ const expressHandler = (
56
61
  // TODO: in theory this is redundant
57
62
  libLogger.tag({ invoke: invokeUuid });
58
63
  libLogger.tag({ shortInvoke: invokeUuid.slice(0, 8) });
64
+ log.tag({ invoke: invokeUuid });
65
+ log.tag({ shortInvoke: invokeUuid.slice(0, 8) });
59
66
  }
60
67
 
61
- libLogger.trace("[jaypie] Express init");
68
+ if (!name) {
69
+ // If handler has a name, use it
70
+ if (handler.name) {
71
+ name = handler.name;
72
+ } else {
73
+ name = JAYPIE.UNKNOWN;
74
+ }
75
+ }
76
+ publicLogger.tag({ handler: name });
77
+ // TODO: in theory this is redundant
78
+ libLogger.tag({ handler: name });
79
+ log.tag({ handler: name });
62
80
 
63
- // Top-level, important details that run at the same level as the main logger
64
- const log = publicLogger.lib({
65
- level: publicLogger.level,
66
- lib: JAYPIE.LIB.EXPRESS,
67
- });
81
+ libLogger.trace("[jaypie] Express init");
68
82
 
69
83
  // Set req.locals if it doesn't exist
70
84
  if (!req.locals) req.locals = {};