@crimson-education/browser-logger 4.1.4-next.0 → 5.0.0-beta.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/README.md +81 -29
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +22 -41
- package/lib/index.js.map +1 -1
- package/lib/logger/consoleTransport.d.ts +1 -1
- package/lib/logger/consoleTransport.d.ts.map +1 -1
- package/lib/logger/consoleTransport.js +16 -22
- package/lib/logger/consoleTransport.js.map +1 -1
- package/lib/logger/datadogTransport.d.ts +1 -1
- package/lib/logger/datadogTransport.d.ts.map +1 -1
- package/lib/logger/datadogTransport.js +4 -8
- package/lib/logger/datadogTransport.js.map +1 -1
- package/lib/logger/index.js +29 -49
- package/lib/logger/index.js.map +1 -1
- package/lib/logger/index.test.js +16 -18
- package/lib/logger/index.test.js.map +1 -1
- package/lib/logger/utils.js +4 -9
- package/lib/logger/utils.js.map +1 -1
- package/lib/reporters/amplifyReporter.d.ts +3 -3
- package/lib/reporters/amplifyReporter.d.ts.map +1 -1
- package/lib/reporters/amplifyReporter.js +154 -82
- package/lib/reporters/amplifyReporter.js.map +1 -1
- package/lib/reporters/amplifyReporter.test.js +9 -12
- package/lib/reporters/amplifyReporter.test.js.map +1 -1
- package/lib/reporters/datadogReporter.d.ts +1 -1
- package/lib/reporters/datadogReporter.d.ts.map +1 -1
- package/lib/reporters/datadogReporter.js +117 -48
- package/lib/reporters/datadogReporter.js.map +1 -1
- package/lib/reporters/gtmReporter.d.ts +1 -1
- package/lib/reporters/gtmReporter.d.ts.map +1 -1
- package/lib/reporters/gtmReporter.js +1 -5
- package/lib/reporters/gtmReporter.js.map +1 -1
- package/lib/reporters/index.js +46 -71
- package/lib/reporters/index.js.map +1 -1
- package/lib/reporters/logReporter.js +24 -34
- package/lib/reporters/logReporter.js.map +1 -1
- package/lib/types/index.js +2 -18
- package/lib/types/index.js.map +1 -1
- package/lib/types/logger.d.ts +3 -3
- package/lib/types/logger.d.ts.map +1 -1
- package/lib/types/logger.js +2 -5
- package/lib/types/logger.js.map +1 -1
- package/lib/types/reporter.d.ts +6 -6
- package/lib/types/reporter.d.ts.map +1 -1
- package/lib/types/reporter.js +1 -2
- package/lib/utils.js +1 -5
- package/lib/utils.js.map +1 -1
- package/lib/utils.test.js +2 -4
- package/lib/utils.test.js.map +1 -1
- package/package.json +15 -13
- package/src/reporters/amplifyReporter.ts +165 -68
- package/src/reporters/datadogReporter.ts +106 -18
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ This library contains a number of reporters that is will send analytics to.
|
|
|
6
6
|
|
|
7
7
|
These must be enabled by calling `Logger.init()`, as seen below.
|
|
8
8
|
|
|
9
|
+
> **Note**: This library has been upgraded to support Node.js 22. Some features have been removed or modified during the upgrade process. See the [Upgrade Notes](#upgrade-notes) section for details.
|
|
10
|
+
|
|
9
11
|
## Install
|
|
10
12
|
|
|
11
13
|
```bash
|
|
@@ -53,9 +55,8 @@ Logger.init({
|
|
|
53
55
|
logTransport: {
|
|
54
56
|
level: Logger.LogLevel.Info,
|
|
55
57
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
allowedTracingOrigins: ['https://my.api.domain']
|
|
58
|
+
trackUserInteractions: true,
|
|
59
|
+
allowedTrackingOrigins: ['https://my.api.domain'],
|
|
59
60
|
},
|
|
60
61
|
|
|
61
62
|
amplify: {
|
|
@@ -66,8 +67,8 @@ Logger.init({
|
|
|
66
67
|
autoTrackEvents: true,
|
|
67
68
|
autoTrackPageViews: true,
|
|
68
69
|
autoTrackSessions: true,
|
|
69
|
-
}
|
|
70
|
-
}
|
|
70
|
+
},
|
|
71
|
+
},
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
Logger.setUser({
|
|
@@ -104,7 +105,6 @@ Global metadata about the service will be added for transport usage after callin
|
|
|
104
105
|
|
|
105
106
|
You can add more Global Metadata at any time by calling `addMetadata()`.
|
|
106
107
|
|
|
107
|
-
|
|
108
108
|
```ts
|
|
109
109
|
export const logger = Logger.createLogger();
|
|
110
110
|
|
|
@@ -133,7 +133,7 @@ E.g. On calls
|
|
|
133
133
|
Logger.trackEvent({
|
|
134
134
|
message: 'my-event',
|
|
135
135
|
toReporters: ['log', 'datadog'],
|
|
136
|
-
excludeReporters: ['datadog']
|
|
136
|
+
excludeReporters: ['datadog'],
|
|
137
137
|
});
|
|
138
138
|
```
|
|
139
139
|
|
|
@@ -165,13 +165,9 @@ You can use `.` to traverse metadata.
|
|
|
165
165
|
Logger.init({
|
|
166
166
|
reporters: {
|
|
167
167
|
log: {
|
|
168
|
-
ignoreMetadataPatterns: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/error\.stack.*/g
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
}
|
|
168
|
+
ignoreMetadataPatterns: ['internalError', 'user.email', /error\.stack.*/g],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
175
171
|
});
|
|
176
172
|
```
|
|
177
173
|
|
|
@@ -220,9 +216,9 @@ Logger.init({
|
|
|
220
216
|
endpoints: {
|
|
221
217
|
recordSession: false,
|
|
222
218
|
recordSessionStop: false,
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
226
222
|
});
|
|
227
223
|
```
|
|
228
224
|
|
|
@@ -252,10 +248,10 @@ Logger.init({
|
|
|
252
248
|
logTransport: {
|
|
253
249
|
level: Logger.LogLevel.Info,
|
|
254
250
|
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
}
|
|
251
|
+
trackUserInteractions: true,
|
|
252
|
+
allowedTrackingOrigins: ['https://my.api.domain'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
259
255
|
});
|
|
260
256
|
```
|
|
261
257
|
|
|
@@ -272,6 +268,7 @@ To configure Amplify, this requires at least `region`, `identityPoolId` and `ana
|
|
|
272
268
|
> You will need to set identityPoolId in your Auth.configure function yourself, otherwise Pinpoint won't work.
|
|
273
269
|
|
|
274
270
|
Auto `Auth.configure`:
|
|
271
|
+
|
|
275
272
|
```ts
|
|
276
273
|
import { config } from '../configuration';
|
|
277
274
|
import * as Logger from '@crimson-education/browser-logger';
|
|
@@ -286,12 +283,13 @@ Logger.init({
|
|
|
286
283
|
autoTrackEvents: true,
|
|
287
284
|
autoTrackPageViews: true,
|
|
288
285
|
autoTrackSessions: true,
|
|
289
|
-
}
|
|
290
|
-
}
|
|
286
|
+
},
|
|
287
|
+
},
|
|
291
288
|
});
|
|
292
289
|
```
|
|
293
290
|
|
|
294
291
|
Manual `Auth.configure`:
|
|
292
|
+
|
|
295
293
|
```ts
|
|
296
294
|
import { Auth } from '@aws-amplify/auth';
|
|
297
295
|
import { config } from '../configuration';
|
|
@@ -314,8 +312,8 @@ Logger.init({
|
|
|
314
312
|
autoTrackEvents: true,
|
|
315
313
|
autoTrackPageViews: true,
|
|
316
314
|
autoTrackSessions: true,
|
|
317
|
-
}
|
|
318
|
-
}
|
|
315
|
+
},
|
|
316
|
+
},
|
|
319
317
|
});
|
|
320
318
|
```
|
|
321
319
|
|
|
@@ -334,16 +332,16 @@ import * as Logger from '@crimson-education/browser-logger';
|
|
|
334
332
|
Logger.init({
|
|
335
333
|
reporters: {
|
|
336
334
|
gtm: true,
|
|
337
|
-
}
|
|
335
|
+
},
|
|
338
336
|
});
|
|
339
337
|
|
|
340
338
|
// With configuration
|
|
341
339
|
Logger.init({
|
|
342
340
|
reporters: {
|
|
343
341
|
gtm: {
|
|
344
|
-
ignoreBreadcrumbCategories: ['fetch']
|
|
345
|
-
}
|
|
346
|
-
}
|
|
342
|
+
ignoreBreadcrumbCategories: ['fetch'],
|
|
343
|
+
},
|
|
344
|
+
},
|
|
347
345
|
});
|
|
348
346
|
```
|
|
349
347
|
|
|
@@ -364,3 +362,57 @@ This is valuable if the content is dynamic, e.g. a user's name:
|
|
|
364
362
|
```
|
|
365
363
|
|
|
366
364
|
This will result in the session saying something like, **clicked on "MyUserName"**.
|
|
365
|
+
|
|
366
|
+
## Upgrade Notes
|
|
367
|
+
|
|
368
|
+
### Node.js 22 Upgrade Changes
|
|
369
|
+
|
|
370
|
+
This library has been upgraded to support Node.js 22. The following changes were made during the upgrade process:
|
|
371
|
+
|
|
372
|
+
#### Datadog Reporter Changes
|
|
373
|
+
|
|
374
|
+
- `trackInteractions` → `trackUserInteractions` (renamed for clarity)
|
|
375
|
+
- `trackFrustrations` → Removed (replaced with custom frustration detection implementation)
|
|
376
|
+
- `allowedTracingOrigins` → `allowedTrackingOrigins` (corrected spelling)
|
|
377
|
+
|
|
378
|
+
#### Amplify Reporter Changes
|
|
379
|
+
|
|
380
|
+
- Updated to use Amplify Gen2 APIs (`@aws-amplify/analytics@7.x`, `@aws-amplify/auth@6.x`)
|
|
381
|
+
- Enhanced auto-tracking capabilities for page views, user interactions, and session state
|
|
382
|
+
- Improved error handling and configuration validation
|
|
383
|
+
|
|
384
|
+
#### Removed Features
|
|
385
|
+
|
|
386
|
+
The following features were removed during the upgrade and have been replaced with custom implementations:
|
|
387
|
+
|
|
388
|
+
1. **Automatic Frustration Detection**: Replaced with custom implementation that detects:
|
|
389
|
+
- Rapid clicks (potential frustration)
|
|
390
|
+
- Form validation errors
|
|
391
|
+
- 404 and network errors
|
|
392
|
+
|
|
393
|
+
2. **Enhanced Auto-tracking**: Replaced with custom implementation that tracks:
|
|
394
|
+
- Page views and route changes
|
|
395
|
+
- User interactions with analytics-enabled elements
|
|
396
|
+
- Session state changes (active/inactive)
|
|
397
|
+
|
|
398
|
+
#### Configuration Updates Required
|
|
399
|
+
|
|
400
|
+
If you're upgrading from a previous version, update your configuration:
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
// Old configuration
|
|
404
|
+
datadog: {
|
|
405
|
+
trackInteractions: true,
|
|
406
|
+
trackFrustrations: true,
|
|
407
|
+
allowedTracingOrigins: ['https://my.api.domain']
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// New configuration
|
|
411
|
+
datadog: {
|
|
412
|
+
trackUserInteractions: true,
|
|
413
|
+
allowedTrackingOrigins: ['https://my.api.domain']
|
|
414
|
+
// trackFrustrations is now handled automatically
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
For more details about the upgrade process and custom implementations, see the individual reporter configuration files.
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ReporterConfigurations, ServiceInfo } from './types';
|
|
|
2
2
|
export * from './types';
|
|
3
3
|
export * from './reporters';
|
|
4
4
|
export * from './logger';
|
|
5
|
-
export
|
|
5
|
+
export type LoggerConfig = ServiceInfo & {
|
|
6
6
|
reporters?: ReporterConfigurations;
|
|
7
7
|
};
|
|
8
8
|
/**
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ9D,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AAEzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ9D,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AAEzB,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAIhF;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,QA2CxC"}
|
package/lib/index.js
CHANGED
|
@@ -1,70 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.init = void 0;
|
|
18
|
-
const logger_1 = require("./logger");
|
|
19
|
-
const reporters_1 = require("./reporters");
|
|
20
|
-
const gtmReporter_1 = require("./reporters/gtmReporter");
|
|
21
|
-
const amplifyReporter_1 = require("./reporters/amplifyReporter");
|
|
22
|
-
const datadogReporter_1 = require("./reporters/datadogReporter");
|
|
23
|
-
const logReporter_1 = require("./reporters/logReporter");
|
|
24
|
-
__exportStar(require("./types"), exports);
|
|
25
|
-
__exportStar(require("./reporters"), exports);
|
|
26
|
-
__exportStar(require("./logger"), exports);
|
|
1
|
+
import { setLogLevel } from './logger';
|
|
2
|
+
import { addMetadata, reporters, setEventLevel } from './reporters';
|
|
3
|
+
import { gtmReporter } from './reporters/gtmReporter';
|
|
4
|
+
import { amplifyReporter } from './reporters/amplifyReporter';
|
|
5
|
+
import { datadogReporter } from './reporters/datadogReporter';
|
|
6
|
+
import { logReporter } from './reporters/logReporter';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './reporters';
|
|
9
|
+
export * from './logger';
|
|
27
10
|
let initialized = false;
|
|
28
11
|
/**
|
|
29
12
|
* Initializes the logger and reporters.
|
|
30
13
|
* @param config Reporter config options.
|
|
31
14
|
*/
|
|
32
|
-
function init(config) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
export function init(config) {
|
|
34
16
|
// Some reporters don't like being initialized multiple times.
|
|
35
17
|
if (initialized) {
|
|
36
18
|
return;
|
|
37
19
|
}
|
|
38
20
|
initialized = true;
|
|
39
21
|
// Log Reporter enabled by default.
|
|
40
|
-
const logReporterConfig =
|
|
22
|
+
const logReporterConfig = config.reporters?.log ?? true;
|
|
41
23
|
if (logReporterConfig !== false) {
|
|
42
|
-
|
|
24
|
+
reporters['log'] = logReporter(config, typeof logReporterConfig === 'boolean' ? {} : logReporterConfig);
|
|
43
25
|
}
|
|
44
|
-
if (
|
|
45
|
-
|
|
26
|
+
if (config.reporters?.datadog) {
|
|
27
|
+
reporters['datadog'] = datadogReporter(config, config.reporters.datadog);
|
|
46
28
|
}
|
|
47
|
-
if (
|
|
48
|
-
|
|
29
|
+
if (config.reporters?.amplify) {
|
|
30
|
+
reporters['amplify'] = amplifyReporter(config, config.reporters.amplify);
|
|
49
31
|
}
|
|
50
|
-
if (
|
|
51
|
-
|
|
32
|
+
if (config.reporters?.gtm) {
|
|
33
|
+
reporters['gtm'] = gtmReporter(config, typeof config.reporters.gtm === 'boolean' ? {} : config.reporters.gtm);
|
|
52
34
|
}
|
|
53
35
|
const defaultMetadata = {
|
|
54
|
-
...(
|
|
36
|
+
...(config.defaultMetadata ?? {}),
|
|
55
37
|
service: config.service,
|
|
56
38
|
environment: config.environment,
|
|
57
39
|
version: config.version,
|
|
58
40
|
};
|
|
59
41
|
// Sets the global log level, if specified.
|
|
60
42
|
if (config.logLevel) {
|
|
61
|
-
|
|
43
|
+
setLogLevel(config.logLevel);
|
|
62
44
|
}
|
|
63
45
|
// Sets the global event level, if specified.
|
|
64
46
|
if (config.eventLevel) {
|
|
65
|
-
|
|
47
|
+
setEventLevel(config.eventLevel);
|
|
66
48
|
}
|
|
67
|
-
|
|
49
|
+
addMetadata(defaultMetadata);
|
|
68
50
|
}
|
|
69
|
-
exports.init = init;
|
|
70
51
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"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AAC,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC;QAC1B,SAAS,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChH,CAAC;IAED,MAAM,eAAe,GAAG;QACtB,GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;IAEF,2CAA2C;IAC3C,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,6CAA6C;IAC7C,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,eAAe,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -14,7 +14,7 @@ declare const colors: {
|
|
|
14
14
|
red: number[];
|
|
15
15
|
yellow: number[];
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ColorizeColor = keyof typeof colors;
|
|
18
18
|
/**
|
|
19
19
|
* Colorize a string with a specified color.
|
|
20
20
|
* @param str String to colorize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleTransport.d.ts","sourceRoot":"","sources":["../../src/logger/consoleTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG3E,QAAA,MAAM,MAAM;;;;;;;;;;;;;;CAcX,CAAC;AACF,
|
|
1
|
+
{"version":3,"file":"consoleTransport.d.ts","sourceRoot":"","sources":["../../src/logger/consoleTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG3E,QAAA,MAAM,MAAM;;;;;;;;;;;;;;CAcX,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,UAGzD;AAWD,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,QAAQ,CAAC;IAEnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,aAAa,CAAC;CACvD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,yBAA8B,6CAgDtE"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.consoleTransport = exports.colorize = void 0;
|
|
4
1
|
// from browser-util-inspect
|
|
5
2
|
const colors = {
|
|
6
3
|
bold: [1, 22],
|
|
@@ -23,39 +20,37 @@ const colors = {
|
|
|
23
20
|
* @param color Color to colorize the string with
|
|
24
21
|
* @returns Colorized string
|
|
25
22
|
*/
|
|
26
|
-
function colorize(str, color) {
|
|
23
|
+
export function colorize(str, color) {
|
|
27
24
|
const colorData = colors[color];
|
|
28
25
|
return '\u001b[' + colorData[0] + 'm' + str + '\u001b[' + colorData[1] + 'm';
|
|
29
26
|
}
|
|
30
|
-
exports.colorize = colorize;
|
|
31
27
|
/**
|
|
32
28
|
* Gets a stack trace from metadata or accompanying error.
|
|
33
29
|
*/
|
|
34
30
|
function getStackTrace(data) {
|
|
35
|
-
|
|
36
|
-
const stack = ((_a = data === null || data === void 0 ? void 0 : data.err) === null || _a === void 0 ? void 0 : _a.stack) || data.stack || data['error.stack'];
|
|
31
|
+
const stack = data?.err?.stack || data.stack || data['error.stack'];
|
|
37
32
|
delete data.stack;
|
|
38
|
-
return stack
|
|
33
|
+
return stack ?? '';
|
|
39
34
|
}
|
|
40
|
-
function consoleTransport(config = {}) {
|
|
41
|
-
var _a, _b, _c;
|
|
35
|
+
export function consoleTransport(config = {}) {
|
|
42
36
|
// Default ignore patterns
|
|
43
|
-
|
|
37
|
+
config.ignoreMetadataPatterns ??= ['application', 'service', 'environment', 'version'];
|
|
44
38
|
// Get the colorizer function, or a no-op if not enabled.
|
|
45
|
-
const colorizer = config.colorize !== false ?
|
|
39
|
+
const colorizer = config.colorize !== false ? config.colorize ?? colorize : (str) => str;
|
|
46
40
|
// Get the log level color function, or use the default colors.
|
|
47
|
-
const getLogLevelColor =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
const getLogLevelColor = config.getLogLevelColor ??
|
|
42
|
+
((level) => {
|
|
43
|
+
return {
|
|
44
|
+
error: 'red',
|
|
45
|
+
warn: 'yellow',
|
|
46
|
+
info: 'cyan',
|
|
47
|
+
debug: 'green',
|
|
48
|
+
}[level];
|
|
49
|
+
});
|
|
55
50
|
const transport = {
|
|
56
51
|
...config,
|
|
57
52
|
log: ({ level, message, timestamp, splat, ...metadata }) => {
|
|
58
|
-
let splatData = splat
|
|
53
|
+
let splatData = splat ?? [];
|
|
59
54
|
const stackTrace = getStackTrace(metadata);
|
|
60
55
|
const strippedInfo = { ...metadata };
|
|
61
56
|
delete strippedInfo['level'];
|
|
@@ -77,5 +72,4 @@ function consoleTransport(config = {}) {
|
|
|
77
72
|
};
|
|
78
73
|
return transport;
|
|
79
74
|
}
|
|
80
|
-
exports.consoleTransport = consoleTransport;
|
|
81
75
|
//# sourceMappingURL=consoleTransport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleTransport.js","sourceRoot":"","sources":["../../src/logger/consoleTransport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consoleTransport.js","sourceRoot":"","sources":["../../src/logger/consoleTransport.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACb,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACf,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAChB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACf,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACf,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACf,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACjB,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACb,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;CACjB,CAAC;AAGF;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAoB;IACxD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,IAAS;IAC9B,MAAM,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC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AY,CAAC,OAAO,CAAC,CAAC;YAE7B,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzC,SAAS,GAAG,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;YAC3C,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACZ,SAAS,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;YACtC,CAAC;YAED,IAAI,UAAU,EAAE,CAAC;gBACf,SAAS,GAAG,CAAC,GAAG,SAAS,EAAE,UAAU,CAAC,CAAC;YACzC,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC;QACjH,CAAC;KACF,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILogTransport, LogTransportConfigBase } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type DatadogLogTransportConfig = LogTransportConfigBase;
|
|
3
3
|
/**
|
|
4
4
|
* A transport that sends logs to Datadog.
|
|
5
5
|
* Note: This requires the datadog reporter to be initialized for it to work.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datadogTransport.d.ts","sourceRoot":"","sources":["../../src/logger/datadogTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIjE,
|
|
1
|
+
{"version":3,"file":"datadogTransport.d.ts","sourceRoot":"","sources":["../../src/logger/datadogTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIjE,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,yBAA8B,iBAStE"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.datadogTransport = void 0;
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
const browser_logs_1 = require("@datadog/browser-logs");
|
|
1
|
+
import { getLogMessage } from './utils';
|
|
2
|
+
import { datadogLogs } from '@datadog/browser-logs';
|
|
6
3
|
/**
|
|
7
4
|
* A transport that sends logs to Datadog.
|
|
8
5
|
* Note: This requires the datadog reporter to be initialized for it to work.
|
|
9
6
|
*/
|
|
10
|
-
function datadogTransport(config = {}) {
|
|
7
|
+
export function datadogTransport(config = {}) {
|
|
11
8
|
const transport = {
|
|
12
9
|
...config,
|
|
13
10
|
log: ({ level, message, ...metadata }) => {
|
|
14
11
|
// Datadog expects a string message.
|
|
15
|
-
|
|
12
|
+
datadogLogs.logger[level](getLogMessage(message), metadata);
|
|
16
13
|
},
|
|
17
14
|
};
|
|
18
15
|
return transport;
|
|
19
16
|
}
|
|
20
|
-
exports.datadogTransport = datadogTransport;
|
|
21
17
|
//# sourceMappingURL=datadogTransport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datadogTransport.js","sourceRoot":"","sources":["../../src/logger/datadogTransport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"datadogTransport.js","sourceRoot":"","sources":["../../src/logger/datadogTransport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAoC,EAAE;IACrE,MAAM,SAAS,GAAkB;QAC/B,GAAG,MAAM;QACT,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,EAAE,EAAE;YACvC,oCAAoC;YACpC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC;KACF,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/lib/logger/index.js
CHANGED
|
@@ -1,52 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.logger = exports.createLogger = exports.setLogLevel = exports.globalLogLevel = exports.logTransports = exports.globalMetadata = void 0;
|
|
18
1
|
/* eslint-disable prefer-rest-params */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
import { LogLevel } from '../types';
|
|
3
|
+
import { filterReporterMetadata } from '../utils';
|
|
4
|
+
import { consoleTransport } from './consoleTransport';
|
|
5
|
+
import { getLogMessage, isAboveLevel } from './utils';
|
|
6
|
+
export * from './consoleTransport';
|
|
7
|
+
export * from './datadogTransport';
|
|
8
|
+
export const globalMetadata = {};
|
|
9
|
+
export const logTransports = [consoleTransport()];
|
|
10
|
+
export let globalLogLevel;
|
|
27
11
|
/**
|
|
28
12
|
* Sets the global log level.
|
|
29
13
|
*/
|
|
30
|
-
function setLogLevel(level) {
|
|
31
|
-
|
|
14
|
+
export function setLogLevel(level) {
|
|
15
|
+
globalLogLevel = level ?? undefined;
|
|
32
16
|
}
|
|
33
|
-
exports.setLogLevel = setLogLevel;
|
|
34
17
|
/**
|
|
35
18
|
* Creates a Logger Instance.
|
|
36
19
|
*/
|
|
37
|
-
function createLogger(options = {}) {
|
|
38
|
-
|
|
39
|
-
const rootMetadata = (_a = options.metadata) !== null && _a !== void 0 ? _a : {};
|
|
20
|
+
export function createLogger(options = {}) {
|
|
21
|
+
const rootMetadata = options.metadata ?? {};
|
|
40
22
|
const logger = {
|
|
41
23
|
// impl loosely based on Winston Logger's dynamic log function
|
|
42
24
|
// https://github.com/winstonjs/winston/blob/master/lib/winston/logger.js
|
|
43
25
|
log() {
|
|
44
|
-
var _a, _b;
|
|
45
26
|
let logInfo;
|
|
46
27
|
// Optimize for the hotpath of logging JSON literals
|
|
47
28
|
if (arguments.length === 1) {
|
|
48
29
|
logInfo = {
|
|
49
|
-
level:
|
|
30
|
+
level: LogLevel.Info,
|
|
50
31
|
...arguments[0],
|
|
51
32
|
};
|
|
52
33
|
}
|
|
@@ -56,7 +37,7 @@ function createLogger(options = {}) {
|
|
|
56
37
|
if (message && typeof message === 'object') {
|
|
57
38
|
logInfo = {
|
|
58
39
|
...message,
|
|
59
|
-
level:
|
|
40
|
+
level: message.level ?? level,
|
|
60
41
|
};
|
|
61
42
|
}
|
|
62
43
|
else {
|
|
@@ -77,7 +58,7 @@ function createLogger(options = {}) {
|
|
|
77
58
|
message,
|
|
78
59
|
};
|
|
79
60
|
if (meta.message) {
|
|
80
|
-
logInfo.message = `${
|
|
61
|
+
logInfo.message = `${getLogMessage(logInfo.message)} ${getLogMessage(meta.message)}`;
|
|
81
62
|
}
|
|
82
63
|
if (meta.stack) {
|
|
83
64
|
logInfo.stack = meta.stack;
|
|
@@ -92,27 +73,27 @@ function createLogger(options = {}) {
|
|
|
92
73
|
}
|
|
93
74
|
}
|
|
94
75
|
// Check if we should log this message
|
|
95
|
-
const minLevel =
|
|
96
|
-
if (minLevel && !
|
|
76
|
+
const minLevel = globalLogLevel ?? options.logLevel;
|
|
77
|
+
if (minLevel && !isAboveLevel(logInfo.level, minLevel)) {
|
|
97
78
|
return logger;
|
|
98
79
|
}
|
|
99
80
|
// Add timestamp and root metadata.
|
|
100
81
|
// Ensure there is a message property.
|
|
101
82
|
logInfo = {
|
|
102
|
-
...
|
|
83
|
+
...globalMetadata,
|
|
103
84
|
...rootMetadata,
|
|
104
85
|
timestamp: new Date().toISOString(),
|
|
105
86
|
...logInfo,
|
|
106
|
-
message:
|
|
87
|
+
message: logInfo.message ?? '',
|
|
107
88
|
};
|
|
108
|
-
for (const transport of
|
|
89
|
+
for (const transport of logTransports) {
|
|
109
90
|
if (transport.logLevel) {
|
|
110
|
-
if (!
|
|
91
|
+
if (!isAboveLevel(logInfo.level, transport.logLevel)) {
|
|
111
92
|
continue;
|
|
112
93
|
}
|
|
113
94
|
}
|
|
114
95
|
transport.log({
|
|
115
|
-
...
|
|
96
|
+
...filterReporterMetadata(logInfo, transport),
|
|
116
97
|
// These would break the transport if excluded.
|
|
117
98
|
level: logInfo.level,
|
|
118
99
|
message: logInfo.message,
|
|
@@ -130,19 +111,18 @@ function createLogger(options = {}) {
|
|
|
130
111
|
logger: this,
|
|
131
112
|
done: ({ message, level, metadata } = {}) => {
|
|
132
113
|
const duration = new Date().getTime() - start.getTime();
|
|
133
|
-
logger.log(level
|
|
114
|
+
logger.log(level ?? LogLevel.Info, message ?? 'Timer Completed', { duration, ...(metadata ?? {}) });
|
|
134
115
|
return true;
|
|
135
116
|
},
|
|
136
117
|
};
|
|
137
118
|
},
|
|
138
119
|
// Forward the log levels into the log function, essentially shortcuts.
|
|
139
|
-
debug: (...args) => logger.log(
|
|
140
|
-
info: (...args) => logger.log(
|
|
141
|
-
warn: (...args) => logger.log(
|
|
142
|
-
error: (...args) => logger.log(
|
|
120
|
+
debug: (...args) => logger.log(LogLevel.Debug, ...args),
|
|
121
|
+
info: (...args) => logger.log(LogLevel.Info, ...args),
|
|
122
|
+
warn: (...args) => logger.log(LogLevel.Warn, ...args),
|
|
123
|
+
error: (...args) => logger.log(LogLevel.Error, ...args),
|
|
143
124
|
};
|
|
144
125
|
return logger;
|
|
145
126
|
}
|
|
146
|
-
|
|
147
|
-
exports.logger = createLogger();
|
|
127
|
+
export const logger = createLogger();
|
|
148
128
|
//# sourceMappingURL=index.js.map
|
package/lib/logger/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAyC,QAAQ,EAAqC,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,MAAM,CAAC,MAAM,cAAc,GAAa,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAoB,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,IAAI,cAAoC,CAAC;AAChD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAsB;IAChD,cAAc,GAAG,KAAK,IAAI,SAAS,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,UAAyB,EAAE;IACtD,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,I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