@fluidframework/telemetry-utils 2.0.0-internal.8.0.0 → 2.0.0-rc.1.0.0
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/CHANGELOG.md +38 -0
- package/README.md +1 -7
- package/api-extractor-esm.json +5 -0
- package/api-extractor-lint.json +1 -10
- package/api-extractor.json +1 -9
- package/api-report/telemetry-utils.api.md +24 -33
- package/dist/eventEmitterWithErrorHandling.d.ts +1 -1
- package/dist/eventEmitterWithErrorHandling.js +1 -1
- package/dist/eventEmitterWithErrorHandling.js.map +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +14 -14
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/telemetry-utils-alpha.d.ts +41 -21
- package/dist/telemetry-utils-beta.d.ts +105 -46
- package/dist/telemetry-utils-public.d.ts +105 -46
- package/dist/telemetry-utils-untrimmed.d.ts +24 -45
- package/dist/telemetryTypes.d.ts +7 -9
- package/dist/telemetryTypes.d.ts.map +1 -1
- package/dist/telemetryTypes.js.map +1 -1
- package/lib/eventEmitterWithErrorHandling.d.ts +1 -1
- package/lib/eventEmitterWithErrorHandling.js +1 -1
- package/lib/eventEmitterWithErrorHandling.js.map +1 -1
- package/lib/index.d.ts +0 -17
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +14 -14
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +1 -1
- package/lib/logger.js.map +1 -1
- package/lib/telemetry-utils-alpha.d.mts +290 -0
- package/lib/{telemetry-utils-alpha.d.ts → telemetry-utils-beta.d.mts} +9 -15
- package/lib/{telemetry-utils-beta.d.ts → telemetry-utils-public.d.mts} +105 -46
- package/lib/{telemetry-utils-untrimmed.d.ts → telemetry-utils-untrimmed.d.mts} +24 -45
- package/lib/telemetryTypes.d.ts +7 -9
- package/lib/telemetryTypes.d.ts.map +1 -1
- package/lib/telemetryTypes.js.map +1 -1
- package/package.json +26 -17
- package/src/eventEmitterWithErrorHandling.ts +1 -1
- package/src/index.ts +0 -19
- package/src/logger.ts +22 -16
- package/src/telemetryTypes.ts +7 -9
- package/lib/telemetry-utils-public.d.ts +0 -205
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @fluidframework/telemetry-utils
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.1.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
8
|
+
|
|
9
|
+
The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
|
|
10
|
+
|
|
11
|
+
- @fluidframework/gitresources
|
|
12
|
+
- @fluidframework/server-kafka-orderer
|
|
13
|
+
- @fluidframework/server-lambdas
|
|
14
|
+
- @fluidframework/server-lambdas-driver
|
|
15
|
+
- @fluidframework/server-local-server
|
|
16
|
+
- @fluidframework/server-memory-orderer
|
|
17
|
+
- @fluidframework/protocol-base
|
|
18
|
+
- @fluidframework/server-routerlicious
|
|
19
|
+
- @fluidframework/server-routerlicious-base
|
|
20
|
+
- @fluidframework/server-services
|
|
21
|
+
- @fluidframework/server-services-client
|
|
22
|
+
- @fluidframework/server-services-core
|
|
23
|
+
- @fluidframework/server-services-ordering-kafkanode
|
|
24
|
+
- @fluidframework/server-services-ordering-rdkafka
|
|
25
|
+
- @fluidframework/server-services-ordering-zookeeper
|
|
26
|
+
- @fluidframework/server-services-shared
|
|
27
|
+
- @fluidframework/server-services-telemetry
|
|
28
|
+
- @fluidframework/server-services-utils
|
|
29
|
+
- @fluidframework/server-test-utils
|
|
30
|
+
- tinylicious
|
|
31
|
+
|
|
32
|
+
- Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
33
|
+
|
|
34
|
+
The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
|
|
35
|
+
changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
|
|
36
|
+
|
|
37
|
+
- Remove deprecated config types from telemetry-utils ([#18839](https://github.com/microsoft/FluidFramework/issues/18839)) [42f17a267c](https://github.com/microsoft/FluidFramework/commits/42f17a267cf796e262da08395cf9fc3cede4bce5)
|
|
38
|
+
|
|
39
|
+
The types `ConfigTypes` and `IConfigProviderBase` were deprecated and are now removed from @fluidframework/telemetry-utils. They continue to exist in @fluidframework/core-interfaces. Please update your reference to use these types from @fluidframework/core-interfaces.
|
|
40
|
+
|
|
3
41
|
## 2.0.0-internal.8.0.0
|
|
4
42
|
|
|
5
43
|
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -13,12 +13,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
|
|
|
13
13
|
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
14
14
|
library consumers should always prefer `^`.
|
|
15
15
|
|
|
16
|
-
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
17
|
-
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
18
|
-
Standard `^` and `~` ranges will not work as expected.
|
|
19
|
-
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
20
|
-
package for more information including tools to convert between version schemes.
|
|
21
|
-
|
|
22
16
|
## Installation
|
|
23
17
|
|
|
24
18
|
To get started, install the package by running the following command:
|
|
@@ -29,7 +23,7 @@ npm i @fluidframework/telemetry-utils
|
|
|
29
23
|
|
|
30
24
|
## API Documentation
|
|
31
25
|
|
|
32
|
-
API documentation for **@fluidframework/telemetry-utils** is available at <https://fluidframework.com/docs/
|
|
26
|
+
API documentation for **@fluidframework/telemetry-utils** is available at <https://fluidframework.com/docs/api/v1/telemetry-utils>.
|
|
33
27
|
|
|
34
28
|
## Contribution Guidelines
|
|
35
29
|
|
package/api-extractor-lint.json
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-lint.json"
|
|
4
|
-
"messages": {
|
|
5
|
-
"extractorMessageReporting": {
|
|
6
|
-
// TODO: remove once base config has this enabled as an error
|
|
7
|
-
"ae-incompatible-release-tags": {
|
|
8
|
-
"logLevel": "error",
|
|
9
|
-
"addToApiReportFile": false
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-lint.json"
|
|
13
4
|
}
|
package/api-extractor.json
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base.json"
|
|
4
|
-
"messages": {
|
|
5
|
-
"extractorMessageReporting": {
|
|
6
|
-
// TODO: Add missing documentation and remove this rule override
|
|
7
|
-
"ae-undocumented": {
|
|
8
|
-
"logLevel": "none"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json"
|
|
12
4
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { EventEmitter } from 'events';
|
|
10
10
|
import { EventEmitterEventType } from '@fluid-internal/client-utils';
|
|
11
|
-
import { IConfigProviderBase
|
|
11
|
+
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
12
12
|
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
13
13
|
import { IErrorBase } from '@fluidframework/core-interfaces';
|
|
14
14
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
@@ -30,13 +30,10 @@ import { TelemetryBaseEventPropertyType } from '@fluidframework/core-interfaces'
|
|
|
30
30
|
import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
|
|
31
31
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
32
32
|
|
|
33
|
-
// @internal @deprecated
|
|
34
|
-
export type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
|
|
35
|
-
|
|
36
33
|
// @internal (undocumented)
|
|
37
34
|
export const connectedEventName = "connected";
|
|
38
35
|
|
|
39
|
-
// @
|
|
36
|
+
// @alpha
|
|
40
37
|
export function createChildLogger(props?: {
|
|
41
38
|
logger?: ITelemetryBaseLogger;
|
|
42
39
|
namespace?: string;
|
|
@@ -73,7 +70,7 @@ export class DataProcessingError extends LoggingError implements IErrorBase, IFl
|
|
|
73
70
|
// @internal (undocumented)
|
|
74
71
|
export const disconnectedEventName = "disconnected";
|
|
75
72
|
|
|
76
|
-
// @
|
|
73
|
+
// @public
|
|
77
74
|
export class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> {
|
|
78
75
|
constructor(errorHandler: (eventName: EventEmitterEventType, error: any) => void);
|
|
79
76
|
// (undocumented)
|
|
@@ -127,7 +124,7 @@ export const hasErrorInstanceId: (x: unknown) => x is {
|
|
|
127
124
|
};
|
|
128
125
|
|
|
129
126
|
// @internal
|
|
130
|
-
export interface IConfigProvider extends
|
|
127
|
+
export interface IConfigProvider extends IConfigProviderBase {
|
|
131
128
|
// (undocumented)
|
|
132
129
|
getBoolean(name: string): boolean | undefined;
|
|
133
130
|
// (undocumented)
|
|
@@ -142,12 +139,6 @@ export interface IConfigProvider extends IConfigProviderBase_2 {
|
|
|
142
139
|
getStringArray(name: string): string[] | undefined;
|
|
143
140
|
}
|
|
144
141
|
|
|
145
|
-
// @internal @deprecated
|
|
146
|
-
export interface IConfigProviderBase {
|
|
147
|
-
// (undocumented)
|
|
148
|
-
getRawConfig(name: string): ConfigTypes;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
142
|
// @internal
|
|
152
143
|
export interface IEventSampler {
|
|
153
144
|
// (undocumented)
|
|
@@ -208,7 +199,7 @@ export interface ITaggedTelemetryPropertyTypeExt {
|
|
|
208
199
|
value: TelemetryEventPropertyTypeExt;
|
|
209
200
|
}
|
|
210
201
|
|
|
211
|
-
// @
|
|
202
|
+
// @public
|
|
212
203
|
export interface ITelemetryErrorEventExt extends ITelemetryPropertiesExt {
|
|
213
204
|
// (undocumented)
|
|
214
205
|
eventName: string;
|
|
@@ -222,7 +213,7 @@ export interface ITelemetryEventExt extends ITelemetryPropertiesExt {
|
|
|
222
213
|
eventName: string;
|
|
223
214
|
}
|
|
224
215
|
|
|
225
|
-
// @
|
|
216
|
+
// @public
|
|
226
217
|
export interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
|
|
227
218
|
// (undocumented)
|
|
228
219
|
category?: TelemetryEventCategory;
|
|
@@ -230,20 +221,20 @@ export interface ITelemetryGenericEventExt extends ITelemetryPropertiesExt {
|
|
|
230
221
|
eventName: string;
|
|
231
222
|
}
|
|
232
223
|
|
|
233
|
-
// @
|
|
224
|
+
// @public
|
|
234
225
|
export interface ITelemetryLoggerExt extends ITelemetryBaseLogger {
|
|
235
226
|
sendErrorEvent(event: ITelemetryErrorEventExt, error?: unknown): void;
|
|
236
227
|
sendPerformanceEvent(event: ITelemetryPerformanceEventExt, error?: unknown, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
237
228
|
sendTelemetryEvent(event: ITelemetryGenericEventExt, error?: unknown, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
238
229
|
}
|
|
239
230
|
|
|
240
|
-
// @
|
|
231
|
+
// @alpha (undocumented)
|
|
241
232
|
export interface ITelemetryLoggerPropertyBag {
|
|
242
233
|
// (undocumented)
|
|
243
234
|
[index: string]: TelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes);
|
|
244
235
|
}
|
|
245
236
|
|
|
246
|
-
// @
|
|
237
|
+
// @alpha (undocumented)
|
|
247
238
|
export interface ITelemetryLoggerPropertyBags {
|
|
248
239
|
// (undocumented)
|
|
249
240
|
all?: ITelemetryLoggerPropertyBag;
|
|
@@ -251,13 +242,13 @@ export interface ITelemetryLoggerPropertyBags {
|
|
|
251
242
|
error?: ITelemetryLoggerPropertyBag;
|
|
252
243
|
}
|
|
253
244
|
|
|
254
|
-
// @
|
|
245
|
+
// @public
|
|
255
246
|
export interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt {
|
|
256
247
|
// (undocumented)
|
|
257
248
|
duration?: number;
|
|
258
249
|
}
|
|
259
250
|
|
|
260
|
-
// @
|
|
251
|
+
// @public
|
|
261
252
|
export interface ITelemetryPropertiesExt {
|
|
262
253
|
// (undocumented)
|
|
263
254
|
[index: string]: TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>;
|
|
@@ -282,7 +273,7 @@ export class LoggingError extends Error implements ILoggingError, Omit<IFluidErr
|
|
|
282
273
|
export function logIfFalse(condition: unknown, logger: ITelemetryBaseLogger, event: string | ITelemetryGenericEvent): condition is true;
|
|
283
274
|
|
|
284
275
|
// @internal
|
|
285
|
-
export function mixinMonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt>(logger: L, ...configs: (
|
|
276
|
+
export function mixinMonitoringContext<L extends ITelemetryBaseLogger = ITelemetryLoggerExt>(logger: L, ...configs: (IConfigProviderBase | undefined)[]): MonitoringContext<L>;
|
|
286
277
|
|
|
287
278
|
// @internal
|
|
288
279
|
export class MockLogger implements ITelemetryBaseLogger {
|
|
@@ -336,19 +327,19 @@ export function overwriteStack(error: IFluidErrorBase | LoggingError, stack: str
|
|
|
336
327
|
|
|
337
328
|
// @internal
|
|
338
329
|
export class PerformanceEvent {
|
|
339
|
-
protected constructor(logger: ITelemetryLoggerExt, event:
|
|
330
|
+
protected constructor(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, emitLogs?: boolean);
|
|
340
331
|
// (undocumented)
|
|
341
|
-
cancel(props?:
|
|
332
|
+
cancel(props?: ITelemetryPropertiesExt, error?: unknown): void;
|
|
342
333
|
// (undocumented)
|
|
343
334
|
get duration(): number;
|
|
344
335
|
// (undocumented)
|
|
345
|
-
end(props?:
|
|
346
|
-
reportEvent(eventNameSuffix: string, props?:
|
|
336
|
+
end(props?: ITelemetryPropertiesExt): void;
|
|
337
|
+
reportEvent(eventNameSuffix: string, props?: ITelemetryPropertiesExt, error?: unknown): void;
|
|
347
338
|
// (undocumented)
|
|
348
|
-
reportProgress(props?:
|
|
349
|
-
static start(logger: ITelemetryLoggerExt, event:
|
|
350
|
-
static timedExec<T>(logger: ITelemetryLoggerExt, event:
|
|
351
|
-
static timedExecAsync<T>(logger: ITelemetryLoggerExt, event:
|
|
339
|
+
reportProgress(props?: ITelemetryPropertiesExt, eventNameSuffix?: string): void;
|
|
340
|
+
static start(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, emitLogs?: boolean): PerformanceEvent;
|
|
341
|
+
static timedExec<T>(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, callback: (event: PerformanceEvent) => T, markers?: IPerformanceEventMarkers, sampleThreshold?: number): T;
|
|
342
|
+
static timedExecAsync<T>(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, callback: (event: PerformanceEvent) => Promise<T>, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, sampleThreshold?: number): Promise<T>;
|
|
352
343
|
}
|
|
353
344
|
|
|
354
345
|
// @internal
|
|
@@ -368,7 +359,7 @@ export class SampledTelemetryHelper implements IDisposable {
|
|
|
368
359
|
}
|
|
369
360
|
|
|
370
361
|
// @internal
|
|
371
|
-
export const sessionStorageConfigProvider: Lazy<
|
|
362
|
+
export const sessionStorageConfigProvider: Lazy<IConfigProviderBase>;
|
|
372
363
|
|
|
373
364
|
// @internal
|
|
374
365
|
export const tagCodeArtifacts: <T extends Record<string, TelemetryEventPropertyType | (() => TelemetryBaseEventPropertyType)>>(values: T) => { [P in keyof T]: (T[P] extends () => TelemetryBaseEventPropertyType ? () => {
|
|
@@ -401,16 +392,16 @@ export enum TelemetryDataTag {
|
|
|
401
392
|
UserData = "UserData"
|
|
402
393
|
}
|
|
403
394
|
|
|
404
|
-
// @
|
|
395
|
+
// @public
|
|
405
396
|
export type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
406
397
|
|
|
407
|
-
// @
|
|
398
|
+
// @public
|
|
408
399
|
export type TelemetryEventPropertyTypeExt = string | number | boolean | undefined | (string | number | boolean)[] | {
|
|
409
400
|
[key: string]: // Flat objects can have the same properties as the event itself
|
|
410
401
|
string | number | boolean | undefined | (string | number | boolean)[];
|
|
411
402
|
};
|
|
412
403
|
|
|
413
|
-
// @
|
|
404
|
+
// @alpha (undocumented)
|
|
414
405
|
export type TelemetryEventPropertyTypes = ITelemetryBaseProperties[string];
|
|
415
406
|
|
|
416
407
|
// @internal @deprecated
|
|
@@ -13,7 +13,7 @@ import { IEvent } from "@fluidframework/core-interfaces";
|
|
|
13
13
|
* @privateRemarks
|
|
14
14
|
* This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.
|
|
15
15
|
* We should consider moving it to the `core-utils` package.
|
|
16
|
-
* @
|
|
16
|
+
* @public
|
|
17
17
|
*/
|
|
18
18
|
export declare class EventEmitterWithErrorHandling<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> {
|
|
19
19
|
private readonly errorHandler;
|
|
@@ -15,7 +15,7 @@ const client_utils_1 = require("@fluid-internal/client-utils");
|
|
|
15
15
|
* @privateRemarks
|
|
16
16
|
* This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.
|
|
17
17
|
* We should consider moving it to the `core-utils` package.
|
|
18
|
-
* @
|
|
18
|
+
* @public
|
|
19
19
|
*/
|
|
20
20
|
class EventEmitterWithErrorHandling extends client_utils_1.TypedEventEmitter {
|
|
21
21
|
constructor(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventEmitterWithErrorHandling.js","sourceRoot":"","sources":["../src/eventEmitterWithErrorHandling.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAAwF;AAGxF;;;;;;;;;;GAUG;AACH,MAAa,6BAEX,SAAQ,gCAAyB;IAClC;IACC,oDAAoD;IACpD,8DAA8D;IAC7C,YAAoE;QAErF,KAAK,EAAE,CAAC;QAFS,iBAAY,GAAZ,YAAY,CAAwD;IAGtF,CAAC;IAEM,IAAI,CAAC,KAA4B,EAAE,GAAG,IAAe;QAC3D,IAAI;YACH,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE;YACf,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAChC,OAAO,IAAI,CAAC;SACZ;IACF,CAAC;CACD;AAnBD,sEAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { TypedEventEmitter, EventEmitterEventType } from \"@fluid-internal/client-utils\";\nimport { IEvent } from \"@fluidframework/core-interfaces\";\n\n/**\n * Event Emitter helper class\n *\n * @remarks\n * Any exceptions thrown by listeners will be caught and raised through \"error\" event.\n * Any exception thrown by \"error\" listeners will propagate to the caller.\n * @privateRemarks\n * This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.\n * We should consider moving it to the `core-utils` package.\n * @
|
|
1
|
+
{"version":3,"file":"eventEmitterWithErrorHandling.js","sourceRoot":"","sources":["../src/eventEmitterWithErrorHandling.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAAwF;AAGxF;;;;;;;;;;GAUG;AACH,MAAa,6BAEX,SAAQ,gCAAyB;IAClC;IACC,oDAAoD;IACpD,8DAA8D;IAC7C,YAAoE;QAErF,KAAK,EAAE,CAAC;QAFS,iBAAY,GAAZ,YAAY,CAAwD;IAGtF,CAAC;IAEM,IAAI,CAAC,KAA4B,EAAE,GAAG,IAAe;QAC3D,IAAI;YACH,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;SAClC;QAAC,OAAO,KAAK,EAAE;YACf,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAChC,OAAO,IAAI,CAAC;SACZ;IACF,CAAC;CACD;AAnBD,sEAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { TypedEventEmitter, EventEmitterEventType } from \"@fluid-internal/client-utils\";\nimport { IEvent } from \"@fluidframework/core-interfaces\";\n\n/**\n * Event Emitter helper class\n *\n * @remarks\n * Any exceptions thrown by listeners will be caught and raised through \"error\" event.\n * Any exception thrown by \"error\" listeners will propagate to the caller.\n * @privateRemarks\n * This probably doesn't belong in this package, as it is not telemetry-specific, and is really only intended for internal fluid-framework use.\n * We should consider moving it to the `core-utils` package.\n * @public\n */\nexport class EventEmitterWithErrorHandling<\n\tTEvent extends IEvent = IEvent,\n> extends TypedEventEmitter<TEvent> {\n\tconstructor(\n\t\t// TODO: use `unknown` instead (breaking API change)\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tprivate readonly errorHandler: (eventName: EventEmitterEventType, error: any) => void,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic emit(event: EventEmitterEventType, ...args: unknown[]): boolean {\n\t\ttry {\n\t\t\treturn super.emit(event, ...args);\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(event, error);\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,21 +14,4 @@ export { ThresholdCounter } from "./thresholdCounter";
|
|
|
14
14
|
export { SampledTelemetryHelper } from "./sampledTelemetryHelper";
|
|
15
15
|
export { logIfFalse, createSampledLogger, IEventSampler, ISampledTelemetryLogger } from "./utils";
|
|
16
16
|
export { TelemetryEventPropertyTypeExt, ITelemetryEventExt, ITelemetryGenericEventExt, ITelemetryErrorEventExt, ITelemetryPerformanceEventExt, ITelemetryLoggerExt, ITaggedTelemetryPropertyTypeExt, ITelemetryPropertiesExt, TelemetryEventCategory, } from "./telemetryTypes";
|
|
17
|
-
/**
|
|
18
|
-
* Types supported by {@link IConfigProviderBase}.
|
|
19
|
-
* @deprecated Use ConfigTypes from fluidFramework/core-interfaces
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export type ConfigTypes = string | number | boolean | number[] | string[] | boolean[] | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Base interface for providing configurations to enable/disable/control features.
|
|
26
|
-
*
|
|
27
|
-
* @deprecated Use IConfigProviderBase from fluidFramework/core-interfaces
|
|
28
|
-
*
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export interface IConfigProviderBase {
|
|
32
|
-
getRawConfig(name: string): ConfigTypes;
|
|
33
|
-
}
|
|
34
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,4BAA4B,EAC5B,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,yBAAyB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,mBAA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version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,4BAA4B,EAC5B,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,yBAAyB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EACZ,UAAU,EACV,oBAAoB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,6BAA6B,EAC7B,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,eAAe,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,uBAA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,kBAAkB,OAAA;AAEnB,mCAiBkB;AAhBjB,iHAAA,uBAAuB,OAAA;AACvB,2GAAA,iBAAiB,OAAA;AACjB,+GAAA,qBAAqB,OAAA;AACrB,oGAAA,UAAU,OAAA;AAKV,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAChB,6GAAA,mBAAmB,OAAA;AACnB,iGAAA,OAAO,OAAA;AACP,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAEhB,6GAAA,mBAAmB,OAAA;AAEpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,iCAAkG;AAAzF,mGAAA,UAAU,OAAA;AAAE,4GAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport {\n\tcreateChildMonitoringContext,\n\tMonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\tIConfigProvider,\n\tloggerToMonitoringContext,\n} from \"./config\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n} from \"./error\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\tIFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events\";\nexport {\n\thasErrorInstanceId,\n\tIFluidErrorBase,\n\tisFluidError,\n\tisValidLegacyError,\n} from \"./fluidErrorBase\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\tIPerformanceEventMarkers,\n\tITelemetryLoggerPropertyBag,\n\tITelemetryLoggerPropertyBags,\n\tMultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\tTelemetryEventPropertyTypes,\n\tTelemetryNullLogger,\n} from \"./logger\";\nexport { MockLogger } from \"./mockLogger\";\nexport { ThresholdCounter } from \"./thresholdCounter\";\nexport { SampledTelemetryHelper } from \"./sampledTelemetryHelper\";\nexport { logIfFalse, createSampledLogger, IEventSampler, ISampledTelemetryLogger } from \"./utils\";\nexport {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITaggedTelemetryPropertyTypeExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes\";\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,mCAOkB;AANjB,sHAAA,4BAA4B,OAAA;AAE5B,sHAAA,4BAA4B,OAAA;AAC5B,gHAAA,sBAAsB,OAAA;AAEtB,mHAAA,yBAAyB,OAAA;AAE1B,iCAOiB;AANhB,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,yHAAA,gCAAgC,OAAA;AAChC,qGAAA,YAAY,OAAA;AACZ,mGAAA,UAAU,OAAA;AACV,6GAAA,oBAAoB,OAAA;AAErB,+CAewB;AAdvB,6HAAA,6BAA6B,OAAA;AAC7B,sHAAA,sBAAsB,OAAA;AACtB,6GAAA,aAAa,OAAA;AACb,mHAAA,mBAAmB,OAAA;AAEnB,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AACf,8HAAA,8BAA8B,OAAA;AAC9B,4GAAA,YAAY,OAAA;AACZ,qHAAA,qBAAqB,OAAA;AACrB,8GAAA,cAAc,OAAA;AACd,8GAAA,cAAc,OAAA;AACd,yGAAA,SAAS,OAAA;AACT,+GAAA,eAAe,OAAA;AAEhB,iFAAgF;AAAvE,8IAAA,6BAA6B,OAAA;AACtC,mCAKkB;AAJjB,4GAAA,kBAAkB,OAAA;AAClB,+GAAA,qBAAqB,OAAA;AACrB,6GAAA,mBAAmB,OAAA;AACnB,wGAAA,cAAc,OAAA;AAEf,mDAK0B;AAJzB,oHAAA,kBAAkB,OAAA;AAElB,8GAAA,YAAY,OAAA;AACZ,oHAAA,kBAAkB,OAAA;AAEnB,mCAiBkB;AAhBjB,iHAAA,uBAAuB,OAAA;AACvB,2GAAA,iBAAiB,OAAA;AACjB,+GAAA,qBAAqB,OAAA;AACrB,oGAAA,UAAU,OAAA;AAKV,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAChB,6GAAA,mBAAmB,OAAA;AACnB,iGAAA,OAAO,OAAA;AACP,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAEhB,6GAAA,mBAAmB,OAAA;AAEpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,iCAAkG;AAAzF,mGAAA,UAAU,OAAA;AAAE,4GAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport {\n\tcreateChildMonitoringContext,\n\tMonitoringContext,\n\tsessionStorageConfigProvider,\n\tmixinMonitoringContext,\n\tIConfigProvider,\n\tloggerToMonitoringContext,\n} from \"./config\";\nexport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n\tGenericError,\n\tUsageError,\n\tvalidatePrecondition,\n} from \"./error\";\nexport {\n\textractLogSafeErrorProperties,\n\tgenerateErrorWithStack,\n\tgenerateStack,\n\tgetCircularReplacer,\n\tIFluidErrorAnnotations,\n\tisExternalError,\n\tisILoggingError,\n\tisTaggedTelemetryPropertyValue,\n\tLoggingError,\n\tNORMALIZED_ERROR_TYPE,\n\tnormalizeError,\n\toverwriteStack,\n\twrapError,\n\twrapErrorAndLog,\n} from \"./errorLogging\";\nexport { EventEmitterWithErrorHandling } from \"./eventEmitterWithErrorHandling\";\nexport {\n\tconnectedEventName,\n\tdisconnectedEventName,\n\traiseConnectedEvent,\n\tsafeRaiseEvent,\n} from \"./events\";\nexport {\n\thasErrorInstanceId,\n\tIFluidErrorBase,\n\tisFluidError,\n\tisValidLegacyError,\n} from \"./fluidErrorBase\";\nexport {\n\teventNamespaceSeparator,\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\tformatTick,\n\tIPerformanceEventMarkers,\n\tITelemetryLoggerPropertyBag,\n\tITelemetryLoggerPropertyBags,\n\tMultiSinkLoggerProperties,\n\tnumberFromString,\n\tPerformanceEvent,\n\tTaggedLoggerAdapter,\n\ttagData,\n\ttagCodeArtifacts,\n\tTelemetryDataTag,\n\tTelemetryEventPropertyTypes,\n\tTelemetryNullLogger,\n} from \"./logger\";\nexport { MockLogger } from \"./mockLogger\";\nexport { ThresholdCounter } from \"./thresholdCounter\";\nexport { SampledTelemetryHelper } from \"./sampledTelemetryHelper\";\nexport { logIfFalse, createSampledLogger, IEventSampler, ISampledTelemetryLogger } from \"./utils\";\nexport {\n\tTelemetryEventPropertyTypeExt,\n\tITelemetryEventExt,\n\tITelemetryGenericEventExt,\n\tITelemetryErrorEventExt,\n\tITelemetryPerformanceEventExt,\n\tITelemetryLoggerExt,\n\tITaggedTelemetryPropertyTypeExt,\n\tITelemetryPropertiesExt,\n\tTelemetryEventCategory,\n} from \"./telemetryTypes\";\n"]}
|
package/dist/logger.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryErrorEvent, ITelemetryGenericEvent, ITelemetryPerformanceEvent,
|
|
5
|
+
import { ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryErrorEvent, ITelemetryGenericEvent, ITelemetryPerformanceEvent, TelemetryBaseEventPropertyType as TelemetryEventPropertyType, LogLevel, Tagged, ITelemetryBaseProperties, TelemetryBaseEventPropertyType } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { IsomorphicPerformance } from "@fluid-internal/client-utils";
|
|
7
|
-
import { ITelemetryGenericEventExt, ITelemetryLoggerExt, ITelemetryPerformanceEventExt, TelemetryEventPropertyTypeExt, TelemetryEventCategory } from "./telemetryTypes";
|
|
7
|
+
import { ITelemetryGenericEventExt, ITelemetryLoggerExt, ITelemetryPerformanceEventExt, TelemetryEventPropertyTypeExt, TelemetryEventCategory, ITelemetryPropertiesExt } from "./telemetryTypes";
|
|
8
8
|
export interface Memory {
|
|
9
9
|
usedJSHeapSize: number;
|
|
10
10
|
}
|
|
@@ -29,17 +29,17 @@ export declare enum TelemetryDataTag {
|
|
|
29
29
|
UserData = "UserData"
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* @
|
|
32
|
+
* @alpha
|
|
33
33
|
*/
|
|
34
34
|
export type TelemetryEventPropertyTypes = ITelemetryBaseProperties[string];
|
|
35
35
|
/**
|
|
36
|
-
* @
|
|
36
|
+
* @alpha
|
|
37
37
|
*/
|
|
38
38
|
export interface ITelemetryLoggerPropertyBag {
|
|
39
39
|
[index: string]: TelemetryEventPropertyTypes | (() => TelemetryEventPropertyTypes);
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* @
|
|
42
|
+
* @alpha
|
|
43
43
|
*/
|
|
44
44
|
export interface ITelemetryLoggerPropertyBags {
|
|
45
45
|
all?: ITelemetryLoggerPropertyBag;
|
|
@@ -154,7 +154,7 @@ export declare class TaggedLoggerAdapter implements ITelemetryBaseLogger {
|
|
|
154
154
|
*
|
|
155
155
|
* @param props - logger is the base logger the child will log to after it's processing, namespace will be prefixed to all event names, properties are default properties that will be applied events.
|
|
156
156
|
*
|
|
157
|
-
* @
|
|
157
|
+
* @alpha
|
|
158
158
|
*/
|
|
159
159
|
export declare function createChildLogger(props?: {
|
|
160
160
|
logger?: ITelemetryBaseLogger;
|
|
@@ -280,7 +280,7 @@ export declare class PerformanceEvent {
|
|
|
280
280
|
* but measurements will still be performed and any specified markers will be generated.
|
|
281
281
|
* @returns An instance of {@link PerformanceEvent}
|
|
282
282
|
*/
|
|
283
|
-
static start(logger: ITelemetryLoggerExt, event:
|
|
283
|
+
static start(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, emitLogs?: boolean): PerformanceEvent;
|
|
284
284
|
/**
|
|
285
285
|
* Measure a synchronous task
|
|
286
286
|
* @param logger - the logger to be used for publishing events
|
|
@@ -296,7 +296,7 @@ export declare class PerformanceEvent {
|
|
|
296
296
|
* so executing either of the tasks will increase the internal counter and they
|
|
297
297
|
* effectively "share" the sampling rate for the event.
|
|
298
298
|
*/
|
|
299
|
-
static timedExec<T>(logger: ITelemetryLoggerExt, event:
|
|
299
|
+
static timedExec<T>(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, callback: (event: PerformanceEvent) => T, markers?: IPerformanceEventMarkers, sampleThreshold?: number): T;
|
|
300
300
|
/**
|
|
301
301
|
* Measure an asynchronous task
|
|
302
302
|
* @param logger - the logger to be used for publishing events
|
|
@@ -313,22 +313,22 @@ export declare class PerformanceEvent {
|
|
|
313
313
|
* so executing either of the tasks will increase the internal counter and they
|
|
314
314
|
* effectively "share" the sampling rate for the event.
|
|
315
315
|
*/
|
|
316
|
-
static timedExecAsync<T>(logger: ITelemetryLoggerExt, event:
|
|
316
|
+
static timedExecAsync<T>(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, callback: (event: PerformanceEvent) => Promise<T>, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, sampleThreshold?: number): Promise<T>;
|
|
317
317
|
get duration(): number;
|
|
318
318
|
private event?;
|
|
319
319
|
private readonly startTime;
|
|
320
320
|
private startMark?;
|
|
321
321
|
private startMemoryCollection;
|
|
322
|
-
protected constructor(logger: ITelemetryLoggerExt, event:
|
|
323
|
-
reportProgress(props?:
|
|
322
|
+
protected constructor(logger: ITelemetryLoggerExt, event: ITelemetryGenericEventExt, markers?: IPerformanceEventMarkers, recordHeapSize?: boolean, emitLogs?: boolean);
|
|
323
|
+
reportProgress(props?: ITelemetryPropertiesExt, eventNameSuffix?: string): void;
|
|
324
324
|
private autoEnd;
|
|
325
|
-
end(props?:
|
|
325
|
+
end(props?: ITelemetryPropertiesExt): void;
|
|
326
326
|
private performanceEndMark;
|
|
327
|
-
cancel(props?:
|
|
327
|
+
cancel(props?: ITelemetryPropertiesExt, error?: unknown): void;
|
|
328
328
|
/**
|
|
329
329
|
* Report the event, if it hasn't already been reported.
|
|
330
330
|
*/
|
|
331
|
-
reportEvent(eventNameSuffix: string, props?:
|
|
331
|
+
reportEvent(eventNameSuffix: string, props?: ITelemetryPropertiesExt, error?: unknown): void;
|
|
332
332
|
private static readonly eventHits;
|
|
333
333
|
private static shouldReport;
|
|
334
334
|
}
|
package/dist/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,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C,YAAY;CAS3B;AAED;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,YAAW,mBAAmB;IACvD,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IACtC,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IACxE,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAClE,oBAAoB,CAAC,KAAK,EAAE,0BAA0B,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CACrF;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,CAAC,EAAE,6BAA6B,GAAG,MAAM,CAAC,6BAA6B,CAAC,GACtE,0BAA0B,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAOjE;AA0BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,sIAIsB,8BAA8B,gEAOhD,8BAA8B;;;;;;oDA4BhB,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,0GAGa,8BAA8B,wDAMhD,8BAA8B;;SAG3C,iBAAiB,YAAY;;;SAI7B,iBAAiB,YAAY;oDAG6C,CAAC"}
|
package/dist/logger.js
CHANGED
|
@@ -266,7 +266,7 @@ exports.TaggedLoggerAdapter = TaggedLoggerAdapter;
|
|
|
266
266
|
*
|
|
267
267
|
* @param props - logger is the base logger the child will log to after it's processing, namespace will be prefixed to all event names, properties are default properties that will be applied events.
|
|
268
268
|
*
|
|
269
|
-
* @
|
|
269
|
+
* @alpha
|
|
270
270
|
*/
|
|
271
271
|
function createChildLogger(props) {
|
|
272
272
|
return ChildLogger.create(props?.logger, props?.namespace, props?.properties);
|