@fluidframework/core-interfaces 2.0.0-internal.6.2.0 → 2.0.0-internal.6.3.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 +28 -0
- package/dist/error.d.ts +4 -4
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +54 -13
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +9 -0
- package/dist/logger.js.map +1 -1
- package/lib/error.d.ts +4 -4
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +8 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +54 -13
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +8 -1
- package/lib/logger.js.map +1 -1
- package/package.json +4 -5
- package/src/error.ts +5 -4
- package/src/index.ts +11 -8
- package/src/logger.ts +58 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @fluidframework/core-interfaces
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.6.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Cleaning up duplicate or misnamed telemetry types ([#17149](https://github.com/microsoft/FluidFramework/issues/17149)) [f9236942fa](https://github.com/microsoft/FluidFramework/commits/f9236942faf03cde860bfcbc7c28f8fbd81d3868)
|
|
8
|
+
|
|
9
|
+
We have two sets of telemetry-related interfaces:
|
|
10
|
+
|
|
11
|
+
- The "Base" ones
|
|
12
|
+
- These have a very bare API surface
|
|
13
|
+
- They are used on public API surfaces to transmit logs across layers
|
|
14
|
+
- The internal ones
|
|
15
|
+
- These have a richer API surface (multiple log functions with different categories,
|
|
16
|
+
support for logging flat arrays and objects)
|
|
17
|
+
- They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface
|
|
18
|
+
|
|
19
|
+
There are two problems with the given state of the world:
|
|
20
|
+
|
|
21
|
+
1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
|
|
22
|
+
2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.
|
|
23
|
+
|
|
24
|
+
This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.
|
|
25
|
+
|
|
26
|
+
Additionally, the following types were adjusted:
|
|
27
|
+
|
|
28
|
+
- `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
|
|
29
|
+
- Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
|
|
30
|
+
|
|
3
31
|
## 2.0.0-internal.6.2.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/dist/error.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ITelemetryBaseProperties } from "./index";
|
|
6
6
|
/**
|
|
7
7
|
* Error types the Fluid Framework may report.
|
|
8
8
|
*/
|
|
@@ -68,10 +68,10 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
68
68
|
*/
|
|
69
69
|
readonly stack?: string;
|
|
70
70
|
/**
|
|
71
|
-
* Returns all properties of this error object that are
|
|
72
|
-
*
|
|
71
|
+
* Returns all properties of this error object that are fit for logging.
|
|
72
|
+
* Some may be tagged to indicate they contain some kind of sensitive data.
|
|
73
73
|
*/
|
|
74
|
-
getTelemetryProperties?():
|
|
74
|
+
getTelemetryProperties?(): ITelemetryBaseProperties;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Generic wrapper for an unrecognized/uncategorized error object
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,eAAe;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AACX,oBAAY,eAAe,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC;IACjD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,wBAAwB,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAChD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,YAAY,CAAC;IACxD,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC9C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,UAAU,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACrD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,eAAe,CAAC;IAC3D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC"}
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"./index\";\n\n/**\n * Error types the Fluid Framework may report.\n */\nexport const FluidErrorTypes = {\n\t/**\n\t * Some error, most likely an exception caught by runtime and propagated to container as critical error\n\t */\n\tgenericError: \"genericError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError: \"throttlingError\",\n\n\t/**\n\t * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n\t */\n\tdataCorruptionError: \"dataCorruptionError\",\n\n\t/**\n\t * Error encountered when processing an operation. May correlate with data corruption.\n\t */\n\tdataProcessingError: \"dataProcessingError\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t */\n\tusageError: \"usageError\",\n} as const;\nexport type FluidErrorTypes = typeof FluidErrorTypes[keyof typeof FluidErrorTypes];\n\n/**\n * Base interface for all errors and warnings emitted the container.\n *\n * @remarks\n *\n * We are in the process of unifying error types across layers of the Framework. For now we have only migrated\n * those from container-definitions. Once fully migrated, this will be a base interface for all errors and\n * warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.\n * Runtime and others will follow soon.\n */\nexport interface IErrorBase extends Partial<Error> {\n\t/**\n\t * A type tag differentiating kinds of errors emitted by the container.\n\t *\n\t * @see See {@link FluidErrorTypes#genericError} for some common examples.\n\t * - container\n\t * - runtime\n\t * - drivers\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error.message}\n\t *\n\t * @remarks\n\t *\n\t * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n\t * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n\t * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name | Error.name}\n\t */\n\treadonly name?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * Returns all properties of this error object that are fit for logging.\n\t * Some may be tagged to indicate they contain some kind of sensitive data.\n\t */\n\tgetTelemetryProperties?(): ITelemetryBaseProperties;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.genericError;\n\terror?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,14 @@ export { IFluidLoadable, IProvideFluidLoadable, IFluidRunnable, IProvideFluidRun
|
|
|
9
9
|
export { IFluidPackageEnvironment, IFluidPackage, isFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, isFluidCodeDetails, IFluidCodeDetailsComparer, IProvideFluidCodeDetailsComparer, } from "./fluidPackage";
|
|
10
10
|
export { IRequest, IRequestHeader, IResponse, IProvideFluidRouter, IFluidRouter, } from "./fluidRouter";
|
|
11
11
|
export { IFluidHandleContext, IProvideFluidHandleContext, IFluidHandle, IProvideFluidHandle, } from "./handles";
|
|
12
|
-
export type { ILoggingError, ITaggedTelemetryPropertyType,
|
|
12
|
+
export type { ILoggingError, ITaggedTelemetryPropertyType, // deprecated
|
|
13
|
+
ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, ITelemetryErrorEvent, // deprecated
|
|
14
|
+
ITelemetryGenericEvent, // deprecated
|
|
15
|
+
ITelemetryLogger, // deprecated
|
|
16
|
+
ITelemetryPerformanceEvent, // deprecated
|
|
17
|
+
ITelemetryProperties, // deprecated
|
|
18
|
+
Tagged, TelemetryEventCategory, // deprecated
|
|
19
|
+
TelemetryBaseEventPropertyType, TelemetryEventPropertyType, } from "./logger";
|
|
13
20
|
export { LogLevel } from "./logger";
|
|
14
21
|
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
|
15
22
|
//# 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;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACX,aAAa,EACb,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACX,aAAa,EACb,4BAA4B,EAAE,aAAa;AAC3C,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EAAE,aAAa;AACnC,sBAAsB,EAAE,aAAa;AACrC,gBAAgB,EAAE,aAAa;AAC/B,0BAA0B,EAAE,aAAa;AACzC,oBAAoB,EAAE,aAAa;AACnC,MAAM,EACN,sBAAsB,EAAE,aAAa;AACrC,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidRouter = exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
|
|
7
|
+
exports.LogLevel = exports.IFluidHandle = exports.IFluidHandleContext = exports.IFluidRouter = exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidRunnable = exports.IFluidLoadable = exports.FluidErrorTypes = void 0;
|
|
8
8
|
var error_1 = require("./error");
|
|
9
9
|
Object.defineProperty(exports, "FluidErrorTypes", { enumerable: true, get: function () { return error_1.FluidErrorTypes; } });
|
|
10
10
|
var fluidLoadable_1 = require("./fluidLoadable");
|
|
@@ -22,4 +22,6 @@ Object.defineProperty(exports, "IFluidRouter", { enumerable: true, get: function
|
|
|
22
22
|
var handles_1 = require("./handles");
|
|
23
23
|
Object.defineProperty(exports, "IFluidHandleContext", { enumerable: true, get: function () { return handles_1.IFluidHandleContext; } });
|
|
24
24
|
Object.defineProperty(exports, "IFluidHandle", { enumerable: true, get: function () { return handles_1.IFluidHandle; } });
|
|
25
|
+
var logger_1 = require("./logger");
|
|
26
|
+
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_1.LogLevel; } });
|
|
25
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iCAMiB;AALhB,wGAAA,eAAe,OAAA;AAkBhB,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AAEd,+GAAA,cAAc,OAAA;AAIf,+CASwB;AANvB,8GAAA,cAAc,OAAA;AAGd,kHAAA,kBAAkB,OAAA;AAClB,yHAAA,yBAAyB,OAAA;AAI1B,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADtB,2GAAA,YAAY,OAAA;AAGb,qCAKmB;AAJlB,8GAAA,mBAAmB,OAAA;AAEnB,uGAAA,YAAY,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable\";\n\nexport {\n\tFluidErrorTypes,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events\";\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport type {\n\tILoggingError,\n\tITaggedTelemetryPropertyType
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iCAMiB;AALhB,wGAAA,eAAe,OAAA;AAkBhB,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AAEd,+GAAA,cAAc,OAAA;AAIf,+CASwB;AANvB,8GAAA,cAAc,OAAA;AAGd,kHAAA,kBAAkB,OAAA;AAClB,yHAAA,yBAAyB,OAAA;AAI1B,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,6CAMuB;AADtB,2GAAA,YAAY,OAAA;AAGb,qCAKmB;AAJlB,8GAAA,mBAAmB,OAAA;AAEnB,uGAAA,YAAY,OAAA;AAoBb,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable\";\n\nexport {\n\tFluidErrorTypes,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events\";\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport type {\n\tILoggingError,\n\tITaggedTelemetryPropertyType, // deprecated\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tITelemetryErrorEvent, // deprecated\n\tITelemetryGenericEvent, // deprecated\n\tITelemetryLogger, // deprecated\n\tITelemetryPerformanceEvent, // deprecated\n\tITelemetryProperties, // deprecated\n\tTagged,\n\tTelemetryEventCategory, // deprecated\n\tTelemetryBaseEventPropertyType,\n\tTelemetryEventPropertyType, // deprecated\n} from \"./logger\";\nexport { LogLevel } from \"./logger\";\nexport { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider\";\n"]}
|
package/dist/logger.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Examples of known categories, however category can be any string for extensibility.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Moved to \@fluidframework/telemetry-utils package
|
|
7
9
|
*/
|
|
8
10
|
export declare type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
9
11
|
/**
|
|
@@ -13,12 +15,29 @@ export declare type TelemetryEventCategory = "generic" | "error" | "performance"
|
|
|
13
15
|
* easily add fields to objects that shouldn't be logged and not realize it's going to be logged.
|
|
14
16
|
* General best practice is to explicitly log the fields you care about from objects.
|
|
15
17
|
*/
|
|
18
|
+
export declare type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc TelemetryBaseEventPropertyType}
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Renamed to {@link TelemetryBaseEventPropertyType}
|
|
23
|
+
*/
|
|
16
24
|
export declare type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
17
25
|
/**
|
|
18
|
-
* A property to be logged to telemetry
|
|
19
|
-
*
|
|
26
|
+
* A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.
|
|
27
|
+
* This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).
|
|
28
|
+
*
|
|
29
|
+
* This indicates that the value should be organized or handled differently by loggers in various first or third
|
|
20
30
|
* party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.
|
|
21
31
|
*/
|
|
32
|
+
export interface Tagged<V, T extends string = string> {
|
|
33
|
+
value: V;
|
|
34
|
+
tag: T;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link Tagged} for info on tagging
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Use Tagged\<TelemetryBaseEventPropertyType\>
|
|
40
|
+
*/
|
|
22
41
|
export interface ITaggedTelemetryPropertyType {
|
|
23
42
|
value: TelemetryEventPropertyType;
|
|
24
43
|
tag: string;
|
|
@@ -26,8 +45,14 @@ export interface ITaggedTelemetryPropertyType {
|
|
|
26
45
|
/**
|
|
27
46
|
* JSON-serializable properties, which will be logged with telemetry.
|
|
28
47
|
*/
|
|
48
|
+
export declare type ITelemetryBaseProperties = ITelemetryProperties;
|
|
49
|
+
/**
|
|
50
|
+
* {@inheritDoc ITelemetryBaseProperties}
|
|
51
|
+
*
|
|
52
|
+
* @deprecated Renamed to {@link ITelemetryBaseProperties}
|
|
53
|
+
*/
|
|
29
54
|
export interface ITelemetryProperties {
|
|
30
|
-
[index: string]: TelemetryEventPropertyType |
|
|
55
|
+
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
|
|
31
56
|
}
|
|
32
57
|
/**
|
|
33
58
|
* Base interface for logging telemetry statements.
|
|
@@ -35,18 +60,22 @@ export interface ITelemetryProperties {
|
|
|
35
60
|
* @param category - category of the event, like "error", "performance", "generic", etc.
|
|
36
61
|
* @param eventName - name of the event.
|
|
37
62
|
*/
|
|
38
|
-
export interface ITelemetryBaseEvent extends
|
|
63
|
+
export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
39
64
|
category: string;
|
|
40
65
|
eventName: string;
|
|
41
66
|
}
|
|
42
67
|
/**
|
|
43
|
-
*
|
|
68
|
+
* Specify levels of the logs.
|
|
44
69
|
*/
|
|
45
|
-
export declare const
|
|
46
|
-
verbose
|
|
47
|
-
default
|
|
48
|
-
error
|
|
49
|
-
}
|
|
70
|
+
export declare const LogLevel: {
|
|
71
|
+
readonly verbose: 10;
|
|
72
|
+
readonly default: 20;
|
|
73
|
+
readonly error: 30;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Specify a level to the log to filter out logs based on the level.
|
|
77
|
+
*/
|
|
78
|
+
export declare type LogLevel = typeof LogLevel[keyof typeof LogLevel];
|
|
50
79
|
/**
|
|
51
80
|
* Interface to output telemetry events.
|
|
52
81
|
* Implemented by hosting app / loader
|
|
@@ -58,6 +87,9 @@ export interface ITelemetryBaseLogger {
|
|
|
58
87
|
/**
|
|
59
88
|
* Informational (non-error) telemetry event
|
|
60
89
|
* Maps to category = "generic"
|
|
90
|
+
*
|
|
91
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \@fluidframework/telemetry-utils.
|
|
92
|
+
* No replacement intended for FluidFramework consumers.
|
|
61
93
|
*/
|
|
62
94
|
export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
63
95
|
eventName: string;
|
|
@@ -66,6 +98,9 @@ export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
|
66
98
|
/**
|
|
67
99
|
* Error telemetry event.
|
|
68
100
|
* Maps to category = "error"
|
|
101
|
+
*
|
|
102
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \@fluidframework/telemetry-utils.
|
|
103
|
+
* No replacement intended for FluidFramework consumers.
|
|
69
104
|
*/
|
|
70
105
|
export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
71
106
|
eventName: string;
|
|
@@ -73,6 +108,9 @@ export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
|
73
108
|
/**
|
|
74
109
|
* Performance telemetry event.
|
|
75
110
|
* Maps to category = "performance"
|
|
111
|
+
*
|
|
112
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \@fluidframework/telemetry-utils.
|
|
113
|
+
* No replacement intended for FluidFramework consumers.
|
|
76
114
|
*/
|
|
77
115
|
export interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
|
|
78
116
|
duration?: number;
|
|
@@ -84,12 +122,15 @@ export interface ILoggingError extends Error {
|
|
|
84
122
|
/**
|
|
85
123
|
* Return all properties from this object that should be logged to telemetry
|
|
86
124
|
*/
|
|
87
|
-
getTelemetryProperties():
|
|
125
|
+
getTelemetryProperties(): ITelemetryBaseProperties;
|
|
88
126
|
}
|
|
89
127
|
/**
|
|
90
128
|
* ITelemetryLogger interface contains various helper telemetry methods,
|
|
91
129
|
* encoding in one place schemas for various types of Fluid telemetry events.
|
|
92
130
|
* Creates sub-logger that appends properties to all events
|
|
131
|
+
*
|
|
132
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \@fluidframework/telemetry-utils.
|
|
133
|
+
* No replacement intended for FluidFramework consumers.
|
|
93
134
|
*/
|
|
94
135
|
export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
95
136
|
/**
|
|
@@ -105,7 +146,7 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
105
146
|
* @param error - optional error object to log
|
|
106
147
|
* @param logLevel - optional level of the log.
|
|
107
148
|
*/
|
|
108
|
-
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
|
|
149
|
+
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
109
150
|
/**
|
|
110
151
|
* Send error telemetry event
|
|
111
152
|
* @param event - Event to send
|
|
@@ -118,6 +159,6 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
118
159
|
* @param error - optional error object to log
|
|
119
160
|
* @param logLevel - optional level of the log.
|
|
120
161
|
*/
|
|
121
|
-
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
|
|
162
|
+
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
122
163
|
}
|
|
123
164
|
//# sourceMappingURL=logger.d.ts.map
|
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
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,oBAAY,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,8BAA8B,GAAG,0BAA0B,CAAC;AAExE;;;;GAIG;AACH,oBAAY,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,0BAA0B,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,oBAAY,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG,0BAA0B,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;CACjF;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;GAEG;AACH,oBAAY,QAAQ,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IACjE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC7D;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;;;OAKG;IAEH,kBAAkB,CACjB,KAAK,EAAE,sBAAsB,EAC7B,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;IAER;;;;OAIG;IAEH,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAE/D;;;;;OAKG;IAEH,oBAAoB,CACnB,KAAK,EAAE,0BAA0B,EACjC,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;CACR"}
|
package/dist/logger.js
CHANGED
|
@@ -4,4 +4,13 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LogLevel = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Specify levels of the logs.
|
|
10
|
+
*/
|
|
11
|
+
exports.LogLevel = {
|
|
12
|
+
verbose: 10,
|
|
13
|
+
default: 20,
|
|
14
|
+
error: 30, // To log errors.
|
|
15
|
+
};
|
|
7
16
|
//# sourceMappingURL=logger.js.map
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Examples of known categories, however category can be any string for extensibility.\n */\nexport type TelemetryEventCategory = \"generic\" | \"error\" | \"performance\";\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n */\nexport type TelemetryEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwEH;;GAEG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Examples of known categories, however category can be any string for extensibility.\n *\n * @deprecated Moved to \\@fluidframework/telemetry-utils package\n */\nexport type TelemetryEventCategory = \"generic\" | \"error\" | \"performance\";\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n */\nexport type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;\n\n/**\n * {@inheritDoc TelemetryBaseEventPropertyType}\n *\n * @deprecated Renamed to {@link TelemetryBaseEventPropertyType}\n */\nexport type TelemetryEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * @see {@link Tagged} for info on tagging\n *\n * @deprecated Use Tagged\\<TelemetryBaseEventPropertyType\\>\n */\nexport interface ITaggedTelemetryPropertyType {\n\tvalue: TelemetryEventPropertyType;\n\ttag: string;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n */\nexport type ITelemetryBaseProperties = ITelemetryProperties;\n\n/**\n * {@inheritDoc ITelemetryBaseProperties}\n *\n * @deprecated Renamed to {@link ITelemetryBaseProperties}\n */\nexport interface ITelemetryProperties {\n\t[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n */\nexport type LogLevel = typeof LogLevel[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n */\nexport interface ITelemetryBaseLogger {\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Informational (non-error) telemetry event\n * Maps to category = \"generic\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryGenericEvent extends ITelemetryProperties {\n\teventName: string;\n\tcategory?: TelemetryEventCategory;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryErrorEvent extends ITelemetryProperties {\n\teventName: string;\n}\n\n/**\n * Performance telemetry event.\n * Maps to category = \"performance\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {\n\tduration?: number; // Duration of event (optional)\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n\n/**\n * ITelemetryLogger interface contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryLogger extends ITelemetryBaseLogger {\n\t/**\n\t * Actual implementation that sends telemetry event\n\t * Implemented by derived classes\n\t * @param event - Telemetry event to send over\n\t * @param logLevel - optional level of the log.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send information telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendTelemetryEvent(\n\t\tevent: ITelemetryGenericEvent,\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n\n\t/**\n\t * Send error telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendErrorEvent(event: ITelemetryErrorEvent, error?: any): void;\n\n\t/**\n\t * Send performance telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEvent,\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n}\n"]}
|
package/lib/error.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ITelemetryBaseProperties } from "./index";
|
|
6
6
|
/**
|
|
7
7
|
* Error types the Fluid Framework may report.
|
|
8
8
|
*/
|
|
@@ -68,10 +68,10 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
68
68
|
*/
|
|
69
69
|
readonly stack?: string;
|
|
70
70
|
/**
|
|
71
|
-
* Returns all properties of this error object that are
|
|
72
|
-
*
|
|
71
|
+
* Returns all properties of this error object that are fit for logging.
|
|
72
|
+
* Some may be tagged to indicate they contain some kind of sensitive data.
|
|
73
73
|
*/
|
|
74
|
-
getTelemetryProperties?():
|
|
74
|
+
getTelemetryProperties?(): ITelemetryBaseProperties;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Generic wrapper for an unrecognized/uncategorized error object
|
package/lib/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,eAAe;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AACX,oBAAY,eAAe,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC;IACjD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,wBAAwB,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAChD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,YAAY,CAAC;IACxD,KAAK,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC9C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,UAAU,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACrD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,eAAe,CAAC,eAAe,CAAC;IAC3D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC"}
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"./index\";\n\n/**\n * Error types the Fluid Framework may report.\n */\nexport const FluidErrorTypes = {\n\t/**\n\t * Some error, most likely an exception caught by runtime and propagated to container as critical error\n\t */\n\tgenericError: \"genericError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError: \"throttlingError\",\n\n\t/**\n\t * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n\t */\n\tdataCorruptionError: \"dataCorruptionError\",\n\n\t/**\n\t * Error encountered when processing an operation. May correlate with data corruption.\n\t */\n\tdataProcessingError: \"dataProcessingError\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t */\n\tusageError: \"usageError\",\n} as const;\nexport type FluidErrorTypes = typeof FluidErrorTypes[keyof typeof FluidErrorTypes];\n\n/**\n * Base interface for all errors and warnings emitted the container.\n *\n * @remarks\n *\n * We are in the process of unifying error types across layers of the Framework. For now we have only migrated\n * those from container-definitions. Once fully migrated, this will be a base interface for all errors and\n * warnings emitted by the Fluid Framework. Currently only the container layer is using IErrorBase.\n * Runtime and others will follow soon.\n */\nexport interface IErrorBase extends Partial<Error> {\n\t/**\n\t * A type tag differentiating kinds of errors emitted by the container.\n\t *\n\t * @see See {@link FluidErrorTypes#genericError} for some common examples.\n\t * - container\n\t * - runtime\n\t * - drivers\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error.message}\n\t *\n\t * @remarks\n\t *\n\t * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n\t * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n\t * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n\t */\n\treadonly message: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name | Error.name}\n\t */\n\treadonly name?: string;\n\n\t/**\n\t * See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}\n\t */\n\treadonly stack?: string;\n\n\t/**\n\t * Returns all properties of this error object that are fit for logging.\n\t * Some may be tagged to indicate they contain some kind of sensitive data.\n\t */\n\tgetTelemetryProperties?(): ITelemetryBaseProperties;\n}\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.genericError;\n\terror?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n\t/**\n\t * {@inheritDoc IErrorBase.errorType}\n\t */\n\treadonly errorType: typeof FluidErrorTypes.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,14 @@ export { IFluidLoadable, IProvideFluidLoadable, IFluidRunnable, IProvideFluidRun
|
|
|
9
9
|
export { IFluidPackageEnvironment, IFluidPackage, isFluidPackage, IFluidCodeDetailsConfig, IFluidCodeDetails, isFluidCodeDetails, IFluidCodeDetailsComparer, IProvideFluidCodeDetailsComparer, } from "./fluidPackage";
|
|
10
10
|
export { IRequest, IRequestHeader, IResponse, IProvideFluidRouter, IFluidRouter, } from "./fluidRouter";
|
|
11
11
|
export { IFluidHandleContext, IProvideFluidHandleContext, IFluidHandle, IProvideFluidHandle, } from "./handles";
|
|
12
|
-
export type { ILoggingError, ITaggedTelemetryPropertyType,
|
|
12
|
+
export type { ILoggingError, ITaggedTelemetryPropertyType, // deprecated
|
|
13
|
+
ITelemetryBaseEvent, ITelemetryBaseLogger, ITelemetryBaseProperties, ITelemetryErrorEvent, // deprecated
|
|
14
|
+
ITelemetryGenericEvent, // deprecated
|
|
15
|
+
ITelemetryLogger, // deprecated
|
|
16
|
+
ITelemetryPerformanceEvent, // deprecated
|
|
17
|
+
ITelemetryProperties, // deprecated
|
|
18
|
+
Tagged, TelemetryEventCategory, // deprecated
|
|
19
|
+
TelemetryBaseEventPropertyType, TelemetryEventPropertyType, } from "./logger";
|
|
13
20
|
export { LogLevel } from "./logger";
|
|
14
21
|
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
|
15
22
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACX,aAAa,EACb,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACX,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,GAChC,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACX,aAAa,EACb,4BAA4B,EAAE,aAAa;AAC3C,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EAAE,aAAa;AACnC,sBAAsB,EAAE,aAAa;AACrC,gBAAgB,EAAE,aAAa;AAC/B,0BAA0B,EAAE,aAAa;AACzC,oBAAoB,EAAE,aAAa;AACnC,MAAM,EACN,sBAAsB,EAAE,aAAa;AACrC,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -10,4 +10,5 @@ export { isFluidPackage, isFluidCodeDetails, IFluidCodeDetailsComparer, } from "
|
|
|
10
10
|
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
|
|
11
11
|
export { IFluidRouter, } from "./fluidRouter";
|
|
12
12
|
export { IFluidHandleContext, IFluidHandle, } from "./handles";
|
|
13
|
+
export { LogLevel } from "./logger";
|
|
13
14
|
//# 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":"AAAA;;;GAGG;AAIH,OAAO,EACN,eAAe,GAKf,MAAM,SAAS,CAAC;AAajB,OAAO,EACN,cAAc,EAEd,cAAc,GAEd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGN,cAAc,EAGd,kBAAkB,EAClB,yBAAyB,GAEzB,MAAM,gBAAgB,CAAC;AAExB,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,OAAO,EAKN,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EAEnB,YAAY,GAEZ,MAAM,WAAW,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable\";\n\nexport {\n\tFluidErrorTypes,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events\";\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport type {\n\tILoggingError,\n\tITaggedTelemetryPropertyType
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,eAAe,GAKf,MAAM,SAAS,CAAC;AAajB,OAAO,EACN,cAAc,EAEd,cAAc,GAEd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGN,cAAc,EAGd,kBAAkB,EAClB,yBAAyB,GAEzB,MAAM,gBAAgB,CAAC;AAExB,+FAA+F;AAC/F,qDAAqD;AACrD,8EAA8E;AAC9E,OAAO,EAKN,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACN,mBAAmB,EAEnB,YAAY,GAEZ,MAAM,WAAW,CAAC;AAkBnB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IDisposable } from \"./disposable\";\n\nexport {\n\tFluidErrorTypes,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\n\nexport type {\n\tExtendEventProvider,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n\tIEventTransformer,\n\tReplaceIEventThisPlaceHolder,\n\tTransformedEvent,\n} from \"./events\";\n\nexport {\n\tIFluidLoadable,\n\tIProvideFluidLoadable,\n\tIFluidRunnable,\n\tIProvideFluidRunnable,\n} from \"./fluidLoadable\";\n\nexport {\n\tIFluidPackageEnvironment,\n\tIFluidPackage,\n\tisFluidPackage,\n\tIFluidCodeDetailsConfig,\n\tIFluidCodeDetails,\n\tisFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n// Typescript forgets the index signature when customers augment IRequestHeader if we export *.\n// So we export the explicit members as a workaround:\n// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038\nexport {\n\tIRequest,\n\tIRequestHeader,\n\tIResponse,\n\tIProvideFluidRouter,\n\tIFluidRouter,\n} from \"./fluidRouter\";\n\nexport {\n\tIFluidHandleContext,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIProvideFluidHandle,\n} from \"./handles\";\n\nexport type {\n\tILoggingError,\n\tITaggedTelemetryPropertyType, // deprecated\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n\tITelemetryErrorEvent, // deprecated\n\tITelemetryGenericEvent, // deprecated\n\tITelemetryLogger, // deprecated\n\tITelemetryPerformanceEvent, // deprecated\n\tITelemetryProperties, // deprecated\n\tTagged,\n\tTelemetryEventCategory, // deprecated\n\tTelemetryBaseEventPropertyType,\n\tTelemetryEventPropertyType, // deprecated\n} from \"./logger\";\nexport { LogLevel } from \"./logger\";\nexport { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from \"./provider\";\n"]}
|
package/lib/logger.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Examples of known categories, however category can be any string for extensibility.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Moved to \@fluidframework/telemetry-utils package
|
|
7
9
|
*/
|
|
8
10
|
export declare type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
9
11
|
/**
|
|
@@ -13,12 +15,29 @@ export declare type TelemetryEventCategory = "generic" | "error" | "performance"
|
|
|
13
15
|
* easily add fields to objects that shouldn't be logged and not realize it's going to be logged.
|
|
14
16
|
* General best practice is to explicitly log the fields you care about from objects.
|
|
15
17
|
*/
|
|
18
|
+
export declare type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc TelemetryBaseEventPropertyType}
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Renamed to {@link TelemetryBaseEventPropertyType}
|
|
23
|
+
*/
|
|
16
24
|
export declare type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
17
25
|
/**
|
|
18
|
-
* A property to be logged to telemetry
|
|
19
|
-
*
|
|
26
|
+
* A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.
|
|
27
|
+
* This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).
|
|
28
|
+
*
|
|
29
|
+
* This indicates that the value should be organized or handled differently by loggers in various first or third
|
|
20
30
|
* party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.
|
|
21
31
|
*/
|
|
32
|
+
export interface Tagged<V, T extends string = string> {
|
|
33
|
+
value: V;
|
|
34
|
+
tag: T;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link Tagged} for info on tagging
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Use Tagged\<TelemetryBaseEventPropertyType\>
|
|
40
|
+
*/
|
|
22
41
|
export interface ITaggedTelemetryPropertyType {
|
|
23
42
|
value: TelemetryEventPropertyType;
|
|
24
43
|
tag: string;
|
|
@@ -26,8 +45,14 @@ export interface ITaggedTelemetryPropertyType {
|
|
|
26
45
|
/**
|
|
27
46
|
* JSON-serializable properties, which will be logged with telemetry.
|
|
28
47
|
*/
|
|
48
|
+
export declare type ITelemetryBaseProperties = ITelemetryProperties;
|
|
49
|
+
/**
|
|
50
|
+
* {@inheritDoc ITelemetryBaseProperties}
|
|
51
|
+
*
|
|
52
|
+
* @deprecated Renamed to {@link ITelemetryBaseProperties}
|
|
53
|
+
*/
|
|
29
54
|
export interface ITelemetryProperties {
|
|
30
|
-
[index: string]: TelemetryEventPropertyType |
|
|
55
|
+
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
|
|
31
56
|
}
|
|
32
57
|
/**
|
|
33
58
|
* Base interface for logging telemetry statements.
|
|
@@ -35,18 +60,22 @@ export interface ITelemetryProperties {
|
|
|
35
60
|
* @param category - category of the event, like "error", "performance", "generic", etc.
|
|
36
61
|
* @param eventName - name of the event.
|
|
37
62
|
*/
|
|
38
|
-
export interface ITelemetryBaseEvent extends
|
|
63
|
+
export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
39
64
|
category: string;
|
|
40
65
|
eventName: string;
|
|
41
66
|
}
|
|
42
67
|
/**
|
|
43
|
-
*
|
|
68
|
+
* Specify levels of the logs.
|
|
44
69
|
*/
|
|
45
|
-
export declare const
|
|
46
|
-
verbose
|
|
47
|
-
default
|
|
48
|
-
error
|
|
49
|
-
}
|
|
70
|
+
export declare const LogLevel: {
|
|
71
|
+
readonly verbose: 10;
|
|
72
|
+
readonly default: 20;
|
|
73
|
+
readonly error: 30;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Specify a level to the log to filter out logs based on the level.
|
|
77
|
+
*/
|
|
78
|
+
export declare type LogLevel = typeof LogLevel[keyof typeof LogLevel];
|
|
50
79
|
/**
|
|
51
80
|
* Interface to output telemetry events.
|
|
52
81
|
* Implemented by hosting app / loader
|
|
@@ -58,6 +87,9 @@ export interface ITelemetryBaseLogger {
|
|
|
58
87
|
/**
|
|
59
88
|
* Informational (non-error) telemetry event
|
|
60
89
|
* Maps to category = "generic"
|
|
90
|
+
*
|
|
91
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \@fluidframework/telemetry-utils.
|
|
92
|
+
* No replacement intended for FluidFramework consumers.
|
|
61
93
|
*/
|
|
62
94
|
export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
63
95
|
eventName: string;
|
|
@@ -66,6 +98,9 @@ export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
|
66
98
|
/**
|
|
67
99
|
* Error telemetry event.
|
|
68
100
|
* Maps to category = "error"
|
|
101
|
+
*
|
|
102
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \@fluidframework/telemetry-utils.
|
|
103
|
+
* No replacement intended for FluidFramework consumers.
|
|
69
104
|
*/
|
|
70
105
|
export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
71
106
|
eventName: string;
|
|
@@ -73,6 +108,9 @@ export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
|
73
108
|
/**
|
|
74
109
|
* Performance telemetry event.
|
|
75
110
|
* Maps to category = "performance"
|
|
111
|
+
*
|
|
112
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \@fluidframework/telemetry-utils.
|
|
113
|
+
* No replacement intended for FluidFramework consumers.
|
|
76
114
|
*/
|
|
77
115
|
export interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
|
|
78
116
|
duration?: number;
|
|
@@ -84,12 +122,15 @@ export interface ILoggingError extends Error {
|
|
|
84
122
|
/**
|
|
85
123
|
* Return all properties from this object that should be logged to telemetry
|
|
86
124
|
*/
|
|
87
|
-
getTelemetryProperties():
|
|
125
|
+
getTelemetryProperties(): ITelemetryBaseProperties;
|
|
88
126
|
}
|
|
89
127
|
/**
|
|
90
128
|
* ITelemetryLogger interface contains various helper telemetry methods,
|
|
91
129
|
* encoding in one place schemas for various types of Fluid telemetry events.
|
|
92
130
|
* Creates sub-logger that appends properties to all events
|
|
131
|
+
*
|
|
132
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \@fluidframework/telemetry-utils.
|
|
133
|
+
* No replacement intended for FluidFramework consumers.
|
|
93
134
|
*/
|
|
94
135
|
export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
95
136
|
/**
|
|
@@ -105,7 +146,7 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
105
146
|
* @param error - optional error object to log
|
|
106
147
|
* @param logLevel - optional level of the log.
|
|
107
148
|
*/
|
|
108
|
-
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
|
|
149
|
+
sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
109
150
|
/**
|
|
110
151
|
* Send error telemetry event
|
|
111
152
|
* @param event - Event to send
|
|
@@ -118,6 +159,6 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
118
159
|
* @param error - optional error object to log
|
|
119
160
|
* @param logLevel - optional level of the log.
|
|
120
161
|
*/
|
|
121
|
-
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: LogLevel.verbose | LogLevel.default): void;
|
|
162
|
+
sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any, logLevel?: typeof LogLevel.verbose | typeof LogLevel.default): void;
|
|
122
163
|
}
|
|
123
164
|
//# sourceMappingURL=logger.d.ts.map
|
package/lib/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,oBAAY,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,8BAA8B,GAAG,0BAA0B,CAAC;AAExE;;;;GAIG;AACH,oBAAY,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,0BAA0B,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,oBAAY,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG,0BAA0B,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;CACjF;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;GAEG;AACH,oBAAY,QAAQ,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IACjE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC7D;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;;;OAKG;IAEH,kBAAkB,CACjB,KAAK,EAAE,sBAAsB,EAC7B,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;IAER;;;;OAIG;IAEH,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAE/D;;;;;OAKG;IAEH,oBAAoB,CACnB,KAAK,EAAE,0BAA0B,EACjC,KAAK,CAAC,EAAE,GAAG,EACX,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,GAC1D,IAAI,CAAC;CACR"}
|
package/lib/logger.js
CHANGED
|
@@ -2,5 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Specify levels of the logs.
|
|
7
|
+
*/
|
|
8
|
+
export const LogLevel = {
|
|
9
|
+
verbose: 10,
|
|
10
|
+
default: 20,
|
|
11
|
+
error: 30, // To log errors.
|
|
12
|
+
};
|
|
6
13
|
//# sourceMappingURL=logger.js.map
|
package/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Examples of known categories, however category can be any string for extensibility.\n */\nexport type TelemetryEventCategory = \"generic\" | \"error\" | \"performance\";\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n */\nexport type TelemetryEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwEH;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Examples of known categories, however category can be any string for extensibility.\n *\n * @deprecated Moved to \\@fluidframework/telemetry-utils package\n */\nexport type TelemetryEventCategory = \"generic\" | \"error\" | \"performance\";\n\n/**\n * Property types that can be logged.\n *\n * @remarks Logging entire objects is considered extremely dangerous from a telemetry point of view because people can\n * easily add fields to objects that shouldn't be logged and not realize it's going to be logged.\n * General best practice is to explicitly log the fields you care about from objects.\n */\nexport type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;\n\n/**\n * {@inheritDoc TelemetryBaseEventPropertyType}\n *\n * @deprecated Renamed to {@link TelemetryBaseEventPropertyType}\n */\nexport type TelemetryEventPropertyType = string | number | boolean | undefined;\n\n/**\n * A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.\n * This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).\n *\n * This indicates that the value should be organized or handled differently by loggers in various first or third\n * party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * @see {@link Tagged} for info on tagging\n *\n * @deprecated Use Tagged\\<TelemetryBaseEventPropertyType\\>\n */\nexport interface ITaggedTelemetryPropertyType {\n\tvalue: TelemetryEventPropertyType;\n\ttag: string;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n */\nexport type ITelemetryBaseProperties = ITelemetryProperties;\n\n/**\n * {@inheritDoc ITelemetryBaseProperties}\n *\n * @deprecated Renamed to {@link ITelemetryBaseProperties}\n */\nexport interface ITelemetryProperties {\n\t[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;\n}\n\n/**\n * Base interface for logging telemetry statements.\n * Can contain any number of properties that get serialized as json payload.\n * @param category - category of the event, like \"error\", \"performance\", \"generic\", etc.\n * @param eventName - name of the event.\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n */\nexport const LogLevel = {\n\tverbose: 10, // To log any verbose event for example when you are debugging something.\n\tdefault: 20, // Default log level\n\terror: 30, // To log errors.\n} as const;\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n */\nexport type LogLevel = typeof LogLevel[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n */\nexport interface ITelemetryBaseLogger {\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\tminLogLevel?: LogLevel;\n}\n\n/**\n * Informational (non-error) telemetry event\n * Maps to category = \"generic\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryGenericEvent extends ITelemetryProperties {\n\teventName: string;\n\tcategory?: TelemetryEventCategory;\n}\n\n/**\n * Error telemetry event.\n * Maps to category = \"error\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryErrorEvent extends ITelemetryProperties {\n\teventName: string;\n}\n\n/**\n * Performance telemetry event.\n * Maps to category = \"performance\"\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {\n\tduration?: number; // Duration of event (optional)\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n */\nexport interface ILoggingError extends Error {\n\t/**\n\t * Return all properties from this object that should be logged to telemetry\n\t */\n\tgetTelemetryProperties(): ITelemetryBaseProperties;\n}\n\n/**\n * ITelemetryLogger interface contains various helper telemetry methods,\n * encoding in one place schemas for various types of Fluid telemetry events.\n * Creates sub-logger that appends properties to all events\n *\n * @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \\@fluidframework/telemetry-utils.\n * No replacement intended for FluidFramework consumers.\n */\nexport interface ITelemetryLogger extends ITelemetryBaseLogger {\n\t/**\n\t * Actual implementation that sends telemetry event\n\t * Implemented by derived classes\n\t * @param event - Telemetry event to send over\n\t * @param logLevel - optional level of the log.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Send information telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendTelemetryEvent(\n\t\tevent: ITelemetryGenericEvent,\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n\n\t/**\n\t * Send error telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendErrorEvent(event: ITelemetryErrorEvent, error?: any): void;\n\n\t/**\n\t * Send performance telemetry event\n\t * @param event - Event to send\n\t * @param error - optional error object to log\n\t * @param logLevel - optional level of the log.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendPerformanceEvent(\n\t\tevent: ITelemetryPerformanceEvent,\n\t\terror?: any,\n\t\tlogLevel?: typeof LogLevel.verbose | typeof LogLevel.default,\n\t): void;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-internal.6.
|
|
3
|
+
"version": "2.0.0-internal.6.3.0",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@fluid-tools/build-cli": "^0.
|
|
18
|
+
"@fluid-tools/build-cli": "^0.22.0",
|
|
19
19
|
"@fluidframework/build-common": "^2.0.0",
|
|
20
|
-
"@fluidframework/build-tools": "^0.
|
|
20
|
+
"@fluidframework/build-tools": "^0.22.0",
|
|
21
21
|
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-internal.6.1.1",
|
|
22
22
|
"@fluidframework/eslint-config-fluid": "^2.1.0",
|
|
23
23
|
"@microsoft/api-extractor": "^7.34.4",
|
|
24
24
|
"@types/node": "^16.18.38",
|
|
25
|
-
"concurrently": "^7.6.0",
|
|
26
25
|
"copyfiles": "^2.4.1",
|
|
27
26
|
"eslint": "~8.6.0",
|
|
28
27
|
"prettier": "~2.6.2",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
44
43
|
"ci:test": "echo No test for this package",
|
|
45
44
|
"ci:test:coverage": "echo No test for this package",
|
|
46
|
-
"clean": "rimraf --glob
|
|
45
|
+
"clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp'",
|
|
47
46
|
"eslint": "eslint --format stylish src",
|
|
48
47
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
49
48
|
"format": "npm run prettier:fix",
|
package/src/error.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ITelemetryBaseProperties } from "./index";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Error types the Fluid Framework may report.
|
|
@@ -77,11 +77,12 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
77
77
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack | Error.stack}
|
|
78
78
|
*/
|
|
79
79
|
readonly stack?: string;
|
|
80
|
+
|
|
80
81
|
/**
|
|
81
|
-
* Returns all properties of this error object that are
|
|
82
|
-
*
|
|
82
|
+
* Returns all properties of this error object that are fit for logging.
|
|
83
|
+
* Some may be tagged to indicate they contain some kind of sensitive data.
|
|
83
84
|
*/
|
|
84
|
-
getTelemetryProperties?():
|
|
85
|
+
getTelemetryProperties?(): ITelemetryBaseProperties;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
package/src/index.ts
CHANGED
|
@@ -62,16 +62,19 @@ export {
|
|
|
62
62
|
|
|
63
63
|
export type {
|
|
64
64
|
ILoggingError,
|
|
65
|
-
ITaggedTelemetryPropertyType,
|
|
65
|
+
ITaggedTelemetryPropertyType, // deprecated
|
|
66
66
|
ITelemetryBaseEvent,
|
|
67
67
|
ITelemetryBaseLogger,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
ITelemetryBaseProperties,
|
|
69
|
+
ITelemetryErrorEvent, // deprecated
|
|
70
|
+
ITelemetryGenericEvent, // deprecated
|
|
71
|
+
ITelemetryLogger, // deprecated
|
|
72
|
+
ITelemetryPerformanceEvent, // deprecated
|
|
73
|
+
ITelemetryProperties, // deprecated
|
|
74
|
+
Tagged,
|
|
75
|
+
TelemetryEventCategory, // deprecated
|
|
76
|
+
TelemetryBaseEventPropertyType,
|
|
77
|
+
TelemetryEventPropertyType, // deprecated
|
|
75
78
|
} from "./logger";
|
|
76
79
|
export { LogLevel } from "./logger";
|
|
77
80
|
export { FluidObjectProviderKeys, FluidObject, FluidObjectKeys } from "./provider";
|
package/src/logger.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Examples of known categories, however category can be any string for extensibility.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated Moved to \@fluidframework/telemetry-utils package
|
|
8
10
|
*/
|
|
9
11
|
export type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
10
12
|
|
|
@@ -15,13 +17,32 @@ export type TelemetryEventCategory = "generic" | "error" | "performance";
|
|
|
15
17
|
* easily add fields to objects that shouldn't be logged and not realize it's going to be logged.
|
|
16
18
|
* General best practice is to explicitly log the fields you care about from objects.
|
|
17
19
|
*/
|
|
20
|
+
export type TelemetryBaseEventPropertyType = TelemetryEventPropertyType;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* {@inheritDoc TelemetryBaseEventPropertyType}
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Renamed to {@link TelemetryBaseEventPropertyType}
|
|
26
|
+
*/
|
|
18
27
|
export type TelemetryEventPropertyType = string | number | boolean | undefined;
|
|
19
28
|
|
|
20
29
|
/**
|
|
21
|
-
* A property to be logged to telemetry
|
|
22
|
-
*
|
|
30
|
+
* A property to be logged to telemetry may require a tag indicating the value may contain sensitive data.
|
|
31
|
+
* This type wraps a value of the given type V in an object along with a string tag (type can be further specified as T).
|
|
32
|
+
*
|
|
33
|
+
* This indicates that the value should be organized or handled differently by loggers in various first or third
|
|
23
34
|
* party scenarios. For example, tags are used to mark data that should not be stored in logs for privacy reasons.
|
|
24
35
|
*/
|
|
36
|
+
export interface Tagged<V, T extends string = string> {
|
|
37
|
+
value: V;
|
|
38
|
+
tag: T;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @see {@link Tagged} for info on tagging
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Use Tagged\<TelemetryBaseEventPropertyType\>
|
|
45
|
+
*/
|
|
25
46
|
export interface ITaggedTelemetryPropertyType {
|
|
26
47
|
value: TelemetryEventPropertyType;
|
|
27
48
|
tag: string;
|
|
@@ -30,8 +51,15 @@ export interface ITaggedTelemetryPropertyType {
|
|
|
30
51
|
/**
|
|
31
52
|
* JSON-serializable properties, which will be logged with telemetry.
|
|
32
53
|
*/
|
|
54
|
+
export type ITelemetryBaseProperties = ITelemetryProperties;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* {@inheritDoc ITelemetryBaseProperties}
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Renamed to {@link ITelemetryBaseProperties}
|
|
60
|
+
*/
|
|
33
61
|
export interface ITelemetryProperties {
|
|
34
|
-
[index: string]: TelemetryEventPropertyType |
|
|
62
|
+
[index: string]: TelemetryEventPropertyType | Tagged<TelemetryEventPropertyType>;
|
|
35
63
|
}
|
|
36
64
|
|
|
37
65
|
/**
|
|
@@ -40,19 +68,24 @@ export interface ITelemetryProperties {
|
|
|
40
68
|
* @param category - category of the event, like "error", "performance", "generic", etc.
|
|
41
69
|
* @param eventName - name of the event.
|
|
42
70
|
*/
|
|
43
|
-
export interface ITelemetryBaseEvent extends
|
|
71
|
+
export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
44
72
|
category: string;
|
|
45
73
|
eventName: string;
|
|
46
74
|
}
|
|
47
75
|
|
|
48
76
|
/**
|
|
49
|
-
*
|
|
77
|
+
* Specify levels of the logs.
|
|
50
78
|
*/
|
|
51
|
-
export const
|
|
52
|
-
verbose
|
|
53
|
-
default
|
|
54
|
-
error
|
|
55
|
-
}
|
|
79
|
+
export const LogLevel = {
|
|
80
|
+
verbose: 10, // To log any verbose event for example when you are debugging something.
|
|
81
|
+
default: 20, // Default log level
|
|
82
|
+
error: 30, // To log errors.
|
|
83
|
+
} as const;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Specify a level to the log to filter out logs based on the level.
|
|
87
|
+
*/
|
|
88
|
+
export type LogLevel = typeof LogLevel[keyof typeof LogLevel];
|
|
56
89
|
|
|
57
90
|
/**
|
|
58
91
|
* Interface to output telemetry events.
|
|
@@ -67,6 +100,9 @@ export interface ITelemetryBaseLogger {
|
|
|
67
100
|
/**
|
|
68
101
|
* Informational (non-error) telemetry event
|
|
69
102
|
* Maps to category = "generic"
|
|
103
|
+
*
|
|
104
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryGenericEventExt in \@fluidframework/telemetry-utils.
|
|
105
|
+
* No replacement intended for FluidFramework consumers.
|
|
70
106
|
*/
|
|
71
107
|
export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
72
108
|
eventName: string;
|
|
@@ -76,6 +112,9 @@ export interface ITelemetryGenericEvent extends ITelemetryProperties {
|
|
|
76
112
|
/**
|
|
77
113
|
* Error telemetry event.
|
|
78
114
|
* Maps to category = "error"
|
|
115
|
+
*
|
|
116
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryErrorEventExt in \@fluidframework/telemetry-utils.
|
|
117
|
+
* No replacement intended for FluidFramework consumers.
|
|
79
118
|
*/
|
|
80
119
|
export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
81
120
|
eventName: string;
|
|
@@ -84,6 +123,9 @@ export interface ITelemetryErrorEvent extends ITelemetryProperties {
|
|
|
84
123
|
/**
|
|
85
124
|
* Performance telemetry event.
|
|
86
125
|
* Maps to category = "performance"
|
|
126
|
+
*
|
|
127
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryPerformanceEventExt in \@fluidframework/telemetry-utils.
|
|
128
|
+
* No replacement intended for FluidFramework consumers.
|
|
87
129
|
*/
|
|
88
130
|
export interface ITelemetryPerformanceEvent extends ITelemetryGenericEvent {
|
|
89
131
|
duration?: number; // Duration of event (optional)
|
|
@@ -96,13 +138,16 @@ export interface ILoggingError extends Error {
|
|
|
96
138
|
/**
|
|
97
139
|
* Return all properties from this object that should be logged to telemetry
|
|
98
140
|
*/
|
|
99
|
-
getTelemetryProperties():
|
|
141
|
+
getTelemetryProperties(): ITelemetryBaseProperties;
|
|
100
142
|
}
|
|
101
143
|
|
|
102
144
|
/**
|
|
103
145
|
* ITelemetryLogger interface contains various helper telemetry methods,
|
|
104
146
|
* encoding in one place schemas for various types of Fluid telemetry events.
|
|
105
147
|
* Creates sub-logger that appends properties to all events
|
|
148
|
+
*
|
|
149
|
+
* @deprecated For internal use within FluidFramework, use ITelemetryLoggerExt in \@fluidframework/telemetry-utils.
|
|
150
|
+
* No replacement intended for FluidFramework consumers.
|
|
106
151
|
*/
|
|
107
152
|
export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
108
153
|
/**
|
|
@@ -123,7 +168,7 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
123
168
|
sendTelemetryEvent(
|
|
124
169
|
event: ITelemetryGenericEvent,
|
|
125
170
|
error?: any,
|
|
126
|
-
logLevel?: LogLevel.verbose | LogLevel.default,
|
|
171
|
+
logLevel?: typeof LogLevel.verbose | typeof LogLevel.default,
|
|
127
172
|
): void;
|
|
128
173
|
|
|
129
174
|
/**
|
|
@@ -144,6 +189,6 @@ export interface ITelemetryLogger extends ITelemetryBaseLogger {
|
|
|
144
189
|
sendPerformanceEvent(
|
|
145
190
|
event: ITelemetryPerformanceEvent,
|
|
146
191
|
error?: any,
|
|
147
|
-
logLevel?: LogLevel.verbose | LogLevel.default,
|
|
192
|
+
logLevel?: typeof LogLevel.verbose | typeof LogLevel.default,
|
|
148
193
|
): void;
|
|
149
194
|
}
|