@fluidframework/core-interfaces 2.100.0 → 2.101.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/api-report/core-interfaces.beta.api.md +2 -0
- package/api-report/core-interfaces.legacy.alpha.api.md +2 -0
- package/api-report/core-interfaces.legacy.beta.api.md +2 -0
- package/api-report/core-interfaces.legacy.public.api.md +2 -0
- package/api-report/core-interfaces.public.api.md +2 -0
- package/dist/logger.d.ts +6 -4
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js.map +1 -1
- package/lib/logger.d.ts +6 -4
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js.map +1 -1
- package/package.json +1 -1
- package/src/logger.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @fluidframework/core-interfaces
|
|
2
2
|
|
|
3
|
+
## 2.101.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Deprecate LogLevel.default and LogLevel.error ([#27207](https://github.com/microsoft/FluidFramework/pull/27207)) [77ef3355fdf](https://github.com/microsoft/FluidFramework/commit/77ef3355fdf9611524cad86f00b1ce8ba3263861)
|
|
8
|
+
|
|
9
|
+
`LogLevel.default` and `LogLevel.error` in `@fluidframework/core-interfaces` are deprecated in favor of the semantically clearer `LogLevel.info` and `LogLevel.essential`.
|
|
10
|
+
|
|
11
|
+
#### Migration
|
|
12
|
+
|
|
13
|
+
The recommended replacement for `LogLevel.default` depends on how the value is used:
|
|
14
|
+
- For an **event's default `logLevel`** (e.g. the `logLevel` argument to `ITelemetryBaseLogger.send`), the recommendation is `LogLevel.essential`.
|
|
15
|
+
- For a logger's **default `minLogLevel`** (the threshold that filters events), `LogLevel.info` is the recommendation.
|
|
16
|
+
|
|
17
|
+
The replacement for `LogLevel.error` should always be `LogLevel.essential`.
|
|
18
|
+
|
|
19
|
+
See [issue #26969](https://github.com/microsoft/FluidFramework/issues/26969) for full guidance and removal tracking (planned for v3.0).
|
|
20
|
+
|
|
3
21
|
## 2.100.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -333,7 +333,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
333
333
|
|
|
334
334
|
// @public
|
|
335
335
|
export interface LogLevelConst {
|
|
336
|
+
// @deprecated
|
|
336
337
|
readonly default: 20;
|
|
338
|
+
// @deprecated
|
|
337
339
|
readonly error: 30;
|
|
338
340
|
readonly essential: 30;
|
|
339
341
|
readonly info: 20;
|
|
@@ -478,7 +478,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
478
478
|
|
|
479
479
|
// @public
|
|
480
480
|
export interface LogLevelConst {
|
|
481
|
+
// @deprecated
|
|
481
482
|
readonly default: 20;
|
|
483
|
+
// @deprecated
|
|
482
484
|
readonly error: 30;
|
|
483
485
|
readonly essential: 30;
|
|
484
486
|
readonly info: 20;
|
|
@@ -465,7 +465,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
465
465
|
|
|
466
466
|
// @public
|
|
467
467
|
export interface LogLevelConst {
|
|
468
|
+
// @deprecated
|
|
468
469
|
readonly default: 20;
|
|
470
|
+
// @deprecated
|
|
469
471
|
readonly error: 30;
|
|
470
472
|
readonly essential: 30;
|
|
471
473
|
readonly info: 20;
|
|
@@ -333,7 +333,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
333
333
|
|
|
334
334
|
// @public
|
|
335
335
|
export interface LogLevelConst {
|
|
336
|
+
// @deprecated
|
|
336
337
|
readonly default: 20;
|
|
338
|
+
// @deprecated
|
|
337
339
|
readonly error: 30;
|
|
338
340
|
readonly essential: 30;
|
|
339
341
|
readonly info: 20;
|
|
@@ -333,7 +333,9 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
333
333
|
|
|
334
334
|
// @public
|
|
335
335
|
export interface LogLevelConst {
|
|
336
|
+
// @deprecated
|
|
336
337
|
readonly default: 20;
|
|
338
|
+
// @deprecated
|
|
337
339
|
readonly error: 30;
|
|
338
340
|
readonly essential: 30;
|
|
339
341
|
readonly info: 20;
|
package/dist/logger.d.ts
CHANGED
|
@@ -73,12 +73,14 @@ export interface LogLevelConst {
|
|
|
73
73
|
readonly essential: 30;
|
|
74
74
|
/**
|
|
75
75
|
* Default LogLevel
|
|
76
|
-
* @
|
|
76
|
+
* @deprecated Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly to preserve prior treatment. Planned to be removed in 3.0.0.
|
|
77
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
77
78
|
*/
|
|
78
79
|
readonly default: 20;
|
|
79
80
|
/**
|
|
80
81
|
* To log errors.
|
|
81
|
-
* @
|
|
82
|
+
* @deprecated Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level. Planned to be removed in 3.0.0.
|
|
83
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
82
84
|
*/
|
|
83
85
|
readonly error: 30;
|
|
84
86
|
}
|
|
@@ -102,12 +104,12 @@ export interface ITelemetryBaseLogger {
|
|
|
102
104
|
/**
|
|
103
105
|
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
104
106
|
* @param event - The event to log.
|
|
105
|
-
* @param logLevel - The log level of the event.
|
|
107
|
+
* @param logLevel - The log level of the event. If undefined, the logLevel should be treated as {@link LogLevelConst.essential | LogLevel.essential}.
|
|
106
108
|
*/
|
|
107
109
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
108
110
|
/**
|
|
109
111
|
* Minimum log level to be logged.
|
|
110
|
-
* @defaultValue {@link LogLevelConst.
|
|
112
|
+
* @defaultValue {@link LogLevelConst.info | LogLevel.info}.
|
|
111
113
|
*/
|
|
112
114
|
minLogLevel?: LogLevel;
|
|
113
115
|
}
|
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;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;IAEvB
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,G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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6FH;;;;GAIG;AACU,QAAA,QAAQ,GAAkB;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\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 * @public\n */\nexport type TelemetryBaseEventPropertyType = 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 * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\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 * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n *\n * @privateRemarks This interface exists solely for documentation. API Extractor does not\n * propagate TSDoc comments from a const's inline type to API reports, so we define the shape\n * here and use LogLevelConst on the LogLevel const to surface member docs.\n *\n * @public\n */\nexport interface LogLevelConst {\n\t/**\n\t * Chatty logs useful for debugging.\n\t * @remarks They need not be collected in production.\n\t */\n\treadonly verbose: 10;\n\n\t/**\n\t * Information about the session.\n\t * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).\n\t * If any are collected from a particular session, all should be.\n\t */\n\treadonly info: 20;\n\n\t/**\n\t * Essential information about the operation of Fluid.\n\t * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.\n\t */\n\treadonly essential: 30;\n\n\t/**\n\t * Default LogLevel\n\t * @deprecated Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly to preserve prior treatment. Planned to be removed in 3.0.0.\n\t * @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.\n\t */\n\treadonly default: 20;\n\n\t/**\n\t * To log errors.\n\t * @deprecated Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level. Planned to be removed in 3.0.0.\n\t * @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.\n\t */\n\treadonly error: 30;\n}\n\n/**\n * Provides runtime {@link (LogLevel:type)} values via symbolic names\n * @see {@link LogLevelConst} type.\n * @public\n */\nexport const LogLevel: LogLevelConst = {\n\tverbose: 10,\n\tinfo: 20,\n\tessential: 30,\n\tdefault: 20,\n\terror: 30,\n};\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. If undefined, the logLevel should be treated as {@link LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link LogLevelConst.info | LogLevel.info}.\n\t */\n\tminLogLevel?: LogLevel;\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 * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\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"]}
|
package/lib/logger.d.ts
CHANGED
|
@@ -73,12 +73,14 @@ export interface LogLevelConst {
|
|
|
73
73
|
readonly essential: 30;
|
|
74
74
|
/**
|
|
75
75
|
* Default LogLevel
|
|
76
|
-
* @
|
|
76
|
+
* @deprecated Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly to preserve prior treatment. Planned to be removed in 3.0.0.
|
|
77
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
77
78
|
*/
|
|
78
79
|
readonly default: 20;
|
|
79
80
|
/**
|
|
80
81
|
* To log errors.
|
|
81
|
-
* @
|
|
82
|
+
* @deprecated Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level. Planned to be removed in 3.0.0.
|
|
83
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
82
84
|
*/
|
|
83
85
|
readonly error: 30;
|
|
84
86
|
}
|
|
@@ -102,12 +104,12 @@ export interface ITelemetryBaseLogger {
|
|
|
102
104
|
/**
|
|
103
105
|
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
104
106
|
* @param event - The event to log.
|
|
105
|
-
* @param logLevel - The log level of the event.
|
|
107
|
+
* @param logLevel - The log level of the event. If undefined, the logLevel should be treated as {@link LogLevelConst.essential | LogLevel.essential}.
|
|
106
108
|
*/
|
|
107
109
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
108
110
|
/**
|
|
109
111
|
* Minimum log level to be logged.
|
|
110
|
-
* @defaultValue {@link LogLevelConst.
|
|
112
|
+
* @defaultValue {@link LogLevelConst.info | LogLevel.info}.
|
|
111
113
|
*/
|
|
112
114
|
minLogLevel?: LogLevel;
|
|
113
115
|
}
|
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;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,CAAC,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,GAAG,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;CACzF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;IAErB;;;;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;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC3C;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,CAAC;CACnD"}
|
package/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6FH;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACT,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\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 * @public\n */\nexport type TelemetryBaseEventPropertyType = 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 * @public\n */\nexport interface Tagged<V, T extends string = string> {\n\tvalue: V;\n\ttag: T;\n}\n\n/**\n * JSON-serializable properties, which will be logged with telemetry.\n * @public\n */\nexport interface ITelemetryBaseProperties {\n\t/**\n\t * Properties of a telemetry event. They are string-indexed, and their values restricted to a known set of\n\t * types (optionally \"wrapped\" with {@link Tagged}).\n\t */\n\t[index: string]: TelemetryBaseEventPropertyType | Tagged<TelemetryBaseEventPropertyType>;\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 * @public\n */\nexport interface ITelemetryBaseEvent extends ITelemetryBaseProperties {\n\tcategory: string;\n\teventName: string;\n}\n\n/**\n * Specify levels of the logs.\n *\n * @privateRemarks This interface exists solely for documentation. API Extractor does not\n * propagate TSDoc comments from a const's inline type to API reports, so we define the shape\n * here and use LogLevelConst on the LogLevel const to surface member docs.\n *\n * @public\n */\nexport interface LogLevelConst {\n\t/**\n\t * Chatty logs useful for debugging.\n\t * @remarks They need not be collected in production.\n\t */\n\treadonly verbose: 10;\n\n\t/**\n\t * Information about the session.\n\t * @remarks These logs could be omitted in some sessions if needed (e.g. to reduce overall telemetry volume).\n\t * If any are collected from a particular session, all should be.\n\t */\n\treadonly info: 20;\n\n\t/**\n\t * Essential information about the operation of Fluid.\n\t * @remarks It is recommended that these should always be collected, even in production, for diagnostic purposes.\n\t */\n\treadonly essential: 30;\n\n\t/**\n\t * Default LogLevel\n\t * @deprecated Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly to preserve prior treatment. Planned to be removed in 3.0.0.\n\t * @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.\n\t */\n\treadonly default: 20;\n\n\t/**\n\t * To log errors.\n\t * @deprecated Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level. Planned to be removed in 3.0.0.\n\t * @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.\n\t */\n\treadonly error: 30;\n}\n\n/**\n * Provides runtime {@link (LogLevel:type)} values via symbolic names\n * @see {@link LogLevelConst} type.\n * @public\n */\nexport const LogLevel: LogLevelConst = {\n\tverbose: 10,\n\tinfo: 20,\n\tessential: 30,\n\tdefault: 20,\n\terror: 30,\n};\n\n/**\n * Specify a level to the log to filter out logs based on the level.\n * @public\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Interface to output telemetry events.\n * Implemented by hosting app / loader\n * @public\n */\nexport interface ITelemetryBaseLogger {\n\t/**\n\t * Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).\n\t * @param event - The event to log.\n\t * @param logLevel - The log level of the event. If undefined, the logLevel should be treated as {@link LogLevelConst.essential | LogLevel.essential}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link LogLevelConst.info | LogLevel.info}.\n\t */\n\tminLogLevel?: LogLevel;\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 * @public\n */\nexport interface ITelemetryErrorEvent extends ITelemetryBaseProperties {\n\teventName: string;\n}\n\n/**\n * An error object that supports exporting its properties to be logged to telemetry\n * @legacy @beta\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"]}
|
package/package.json
CHANGED
package/src/logger.ts
CHANGED
|
@@ -81,13 +81,15 @@ export interface LogLevelConst {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Default LogLevel
|
|
84
|
-
* @
|
|
84
|
+
* @deprecated Prefer {@link LogLevelConst.info | LogLevel.info} when selecting a level explicitly to preserve prior treatment. Planned to be removed in 3.0.0.
|
|
85
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
85
86
|
*/
|
|
86
87
|
readonly default: 20;
|
|
87
88
|
|
|
88
89
|
/**
|
|
89
90
|
* To log errors.
|
|
90
|
-
* @
|
|
91
|
+
* @deprecated Prefer {@link LogLevelConst.essential | LogLevel.essential} when selecting a level. Planned to be removed in 3.0.0.
|
|
92
|
+
* @see {@link https://github.com/microsoft/FluidFramework/issues/26969 | Issue #26969} for removal tracking.
|
|
91
93
|
*/
|
|
92
94
|
readonly error: 30;
|
|
93
95
|
}
|
|
@@ -120,13 +122,13 @@ export interface ITelemetryBaseLogger {
|
|
|
120
122
|
/**
|
|
121
123
|
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
122
124
|
* @param event - The event to log.
|
|
123
|
-
* @param logLevel - The log level of the event.
|
|
125
|
+
* @param logLevel - The log level of the event. If undefined, the logLevel should be treated as {@link LogLevelConst.essential | LogLevel.essential}.
|
|
124
126
|
*/
|
|
125
127
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
126
128
|
|
|
127
129
|
/**
|
|
128
130
|
* Minimum log level to be logged.
|
|
129
|
-
* @defaultValue {@link LogLevelConst.
|
|
131
|
+
* @defaultValue {@link LogLevelConst.info | LogLevel.info}.
|
|
130
132
|
*/
|
|
131
133
|
minLogLevel?: LogLevel;
|
|
132
134
|
}
|