@fluidframework/core-interfaces 2.0.0-dev-rc.5.0.0.271717 → 2.0.0-dev-rc.5.0.0.272251
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/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-report/core-interfaces.alpha.api.md +0 -2
- package/api-report/core-interfaces.beta.api.md +0 -2
- package/api-report/core-interfaces.public.api.md +0 -2
- package/dist/logger.d.ts +9 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js.map +1 -1
- package/lib/logger.d.ts +9 -0
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js.map +1 -1
- package/package.json +8 -2
- package/src/logger.ts +9 -0
- package/tsdoc.json +4 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
|
@@ -345,9 +345,7 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
|
345
345
|
|
|
346
346
|
// @public
|
|
347
347
|
export interface ITelemetryBaseLogger {
|
|
348
|
-
// (undocumented)
|
|
349
348
|
minLogLevel?: LogLevel;
|
|
350
|
-
// (undocumented)
|
|
351
349
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
352
350
|
}
|
|
353
351
|
|
|
@@ -296,9 +296,7 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
|
296
296
|
|
|
297
297
|
// @public
|
|
298
298
|
export interface ITelemetryBaseLogger {
|
|
299
|
-
// (undocumented)
|
|
300
299
|
minLogLevel?: LogLevel;
|
|
301
|
-
// (undocumented)
|
|
302
300
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
303
301
|
}
|
|
304
302
|
|
|
@@ -296,9 +296,7 @@ export interface ITelemetryBaseEvent extends ITelemetryBaseProperties {
|
|
|
296
296
|
|
|
297
297
|
// @public
|
|
298
298
|
export interface ITelemetryBaseLogger {
|
|
299
|
-
// (undocumented)
|
|
300
299
|
minLogLevel?: LogLevel;
|
|
301
|
-
// (undocumented)
|
|
302
300
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
303
301
|
}
|
|
304
302
|
|
package/dist/logger.d.ts
CHANGED
|
@@ -65,7 +65,16 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
65
65
|
* @public
|
|
66
66
|
*/
|
|
67
67
|
export interface ITelemetryBaseLogger {
|
|
68
|
+
/**
|
|
69
|
+
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
70
|
+
* @param event - The event to log.
|
|
71
|
+
* @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
|
|
72
|
+
*/
|
|
68
73
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
74
|
+
/**
|
|
75
|
+
* Minimum log level to be logged.
|
|
76
|
+
* @defaultValue {@link (LogLevel:variable).default}
|
|
77
|
+
*/
|
|
69
78
|
minLogLevel?: LogLevel;
|
|
70
79
|
}
|
|
71
80
|
/**
|
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;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAA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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/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiDH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,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 * 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 * @public\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 * @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\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\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 * @alpha\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"]}
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiDH;;;GAGG;AACU,QAAA,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,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 * 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 * @public\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 * @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. Default: {@link (LogLevel:variable).default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link (LogLevel:variable).default}\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 * @alpha\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
|
@@ -65,7 +65,16 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
65
65
|
* @public
|
|
66
66
|
*/
|
|
67
67
|
export interface ITelemetryBaseLogger {
|
|
68
|
+
/**
|
|
69
|
+
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
70
|
+
* @param event - The event to log.
|
|
71
|
+
* @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
|
|
72
|
+
*/
|
|
68
73
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
74
|
+
/**
|
|
75
|
+
* Minimum log level to be logged.
|
|
76
|
+
* @defaultValue {@link (LogLevel:variable).default}
|
|
77
|
+
*/
|
|
69
78
|
minLogLevel?: LogLevel;
|
|
70
79
|
}
|
|
71
80
|
/**
|
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;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;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;;;;;;;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"}
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG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H,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,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 * 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 * @public\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 * @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\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\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 * @alpha\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"]}
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,OAAO,EAAE,EAAE,EAAE,yEAAyE;IACtF,OAAO,EAAE,EAAE,EAAE,oBAAoB;IACjC,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 * 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 * @public\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 * @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. Default: {@link (LogLevel:variable).default}.\n\t */\n\tsend(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;\n\n\t/**\n\t * Minimum log level to be logged.\n\t * @defaultValue {@link (LogLevel:variable).default}\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 * @alpha\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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-dev-rc.5.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.272251",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
57
57
|
"@microsoft/api-extractor": "^7.45.1",
|
|
58
58
|
"@types/node": "^18.19.0",
|
|
59
|
+
"concurrently": "^8.2.1",
|
|
59
60
|
"copyfiles": "^2.4.1",
|
|
60
61
|
"eslint": "~8.55.0",
|
|
61
62
|
"prettier": "~3.0.3",
|
|
@@ -79,9 +80,14 @@
|
|
|
79
80
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
80
81
|
"check:are-the-types-wrong": "attw --pack .",
|
|
81
82
|
"check:biome": "biome check . --formatter-enabled=true",
|
|
83
|
+
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
84
|
+
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
85
|
+
"check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
|
|
86
|
+
"check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
|
|
87
|
+
"check:exports:esm:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.esm.json",
|
|
88
|
+
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
82
89
|
"check:format": "npm run check:prettier",
|
|
83
90
|
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
84
|
-
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
85
91
|
"ci:build": "npm run build:compile",
|
|
86
92
|
"ci:build:docs": "api-extractor run",
|
|
87
93
|
"ci:test": "echo No test for this package",
|
package/src/logger.ts
CHANGED
|
@@ -72,8 +72,17 @@ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
74
|
export interface ITelemetryBaseLogger {
|
|
75
|
+
/**
|
|
76
|
+
* Log a telemetry event, if it meets the appropriate log-level threshold (see {@link ITelemetryBaseLogger.minLogLevel}).
|
|
77
|
+
* @param event - The event to log.
|
|
78
|
+
* @param logLevel - The log level of the event. Default: {@link (LogLevel:variable).default}.
|
|
79
|
+
*/
|
|
75
80
|
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
|
|
76
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Minimum log level to be logged.
|
|
84
|
+
* @defaultValue {@link (LogLevel:variable).default}
|
|
85
|
+
*/
|
|
77
86
|
minLogLevel?: LogLevel;
|
|
78
87
|
}
|
|
79
88
|
|
package/tsdoc.json
ADDED