From 982969265917734fad7f7370c55f44379038168b Mon Sep 17 00:00:00 2001 From: Alex Villarreal <716334+alexvy86@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:01:33 -0600 Subject: [PATCH] Reapply "refactor(telemetry-utlis): Make MockLogger internal" (#23035) This reverts commit 25913c778093999bc6421de0d7b97182ff3a98b5. --- .changeset/green-readers-burn.md | 13 +++++++++++ .../telemetry-utils.legacy.alpha.api.md | 18 --------------- .../utils/telemetry-utils/src/mockLogger.ts | 23 +------------------ 3 files changed, 14 insertions(+), 40 deletions(-) create mode 100644 .changeset/green-readers-burn.md diff --git a/.changeset/green-readers-burn.md b/.changeset/green-readers-burn.md new file mode 100644 index 000000000000..60c5264616e8 --- /dev/null +++ b/.changeset/green-readers-burn.md @@ -0,0 +1,13 @@ +--- +"@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 dccaecb1069f..1ce147013080 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,24 +55,6 @@ 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 be46d59cfd43..f2f3e3dceee0 100644 --- a/packages/utils/telemetry-utils/src/mockLogger.ts +++ b/packages/utils/telemetry-utils/src/mockLogger.ts @@ -25,28 +25,7 @@ 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. * - * @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 + * @internal */ export class MockLogger implements ITelemetryBaseLogger { /**