diff --git a/.changeset/green-readers-burn.md b/.changeset/green-readers-burn.md deleted file mode 100644 index 60c5264616e8..000000000000 --- a/.changeset/green-readers-burn.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@fluidframework/telemetry-utils": minor ---- ---- -"section": legacy ---- - -`MockLogger` has been removed from the alpha+legacy API surface - -The `MockLogger` class previously exposed in the alpha+legacy API surface of `@fluidframework/telemetry-utils` has -been removed. -No replacement is provided, as this class was only intended for use in testing scenarios, and should be trivial to -re-implement in any codebase that still uses it. diff --git a/packages/utils/telemetry-utils/api-report/telemetry-utils.legacy.alpha.api.md b/packages/utils/telemetry-utils/api-report/telemetry-utils.legacy.alpha.api.md index 1ce147013080..dccaecb1069f 100644 --- a/packages/utils/telemetry-utils/api-report/telemetry-utils.legacy.alpha.api.md +++ b/packages/utils/telemetry-utils/api-report/telemetry-utils.legacy.alpha.api.md @@ -55,6 +55,24 @@ export interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt // @alpha export type ITelemetryPropertiesExt = Record>; +// @alpha @deprecated +export class MockLogger implements ITelemetryBaseLogger { + constructor(minLogLevel?: LogLevel); + assertMatch(expectedEvents: Omit[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void; + assertMatchAny(expectedEvents: Omit[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void; + assertMatchNone(disallowedEvents: Omit[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void; + assertMatchStrict(expectedEvents: Omit[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void; + clear(): void; + get events(): readonly ITelemetryBaseEvent[]; + matchAnyEvent(expectedEvents: Omit[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean; + matchEvents(expectedEvents: Omit[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean; + matchEventStrict(expectedEvents: Omit[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean; + readonly minLogLevel: LogLevel; + send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void; + // (undocumented) + toTelemetryLogger(): ITelemetryLoggerExt; +} + // @alpha export type TelemetryEventCategory = "generic" | "error" | "performance"; diff --git a/packages/utils/telemetry-utils/src/mockLogger.ts b/packages/utils/telemetry-utils/src/mockLogger.ts index 99ed93dd14d1..23714cd9ed0a 100644 --- a/packages/utils/telemetry-utils/src/mockLogger.ts +++ b/packages/utils/telemetry-utils/src/mockLogger.ts @@ -23,7 +23,28 @@ import type { * Records events sent to it, and then can walk back over those events, searching for a set of expected events to * match against the logged events. * - * @internal + * @deprecated + * + * This class is not intended for use outside of the `fluid-framework` repo, and will be removed from + * package exports in the near future. + * + * Please migrate usages by either creating your own mock {@link @fluidframework/core-interfaces#ITelemetryBaseLogger} + * implementation, or by copying this code as-is into your own repo. + * + * @privateRemarks TODO: When we are ready, this type should be made `internal`, and the deprecation notice should be removed. + * + * @deprecated + * + * This class is not intended for use outside of the `fluid-framework` repo, and will be removed from + * package exports in the near future. + * + * Please migrate usages by either creating your own mock {@link @fluidframework/core-interfaces#ITelemetryBaseLogger} + * implementation, or by copying this code as-is into your own repo. + * + * @privateRemarks TODO: When we are ready, this type should be made `internal`, and the deprecation notice should be removed. + * + * @legacy + * @alpha */ export class MockLogger implements ITelemetryBaseLogger { /**