Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(telemetry-utlis): Make MockLogger internal #23473

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/green-readers-burn.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ export interface ITelemetryPerformanceEventExt extends ITelemetryGenericEventExt
// @alpha
export type ITelemetryPropertiesExt = Record<string, TelemetryEventPropertyTypeExt | Tagged<TelemetryEventPropertyTypeExt>>;

// @alpha @deprecated
export class MockLogger implements ITelemetryBaseLogger {
constructor(minLogLevel?: LogLevel);
assertMatch(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void;
assertMatchAny(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void;
assertMatchNone(disallowedEvents: Omit<ITelemetryBaseEvent, "category">[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void;
assertMatchStrict(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], message?: string, inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): void;
clear(): void;
get events(): readonly ITelemetryBaseEvent[];
matchAnyEvent(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean;
matchEvents(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean;
matchEventStrict(expectedEvents: Omit<ITelemetryBaseEvent, "category">[], inlineDetailsProp?: boolean, clearEventsAfterCheck?: boolean): boolean;
readonly minLogLevel: LogLevel;
send(event: ITelemetryBaseEvent, logLevel?: LogLevel): void;
// (undocumented)
toTelemetryLogger(): ITelemetryLoggerExt;
}

// @alpha
export type TelemetryEventCategory = "generic" | "error" | "performance";

Expand Down
23 changes: 1 addition & 22 deletions packages/utils/telemetry-utils/src/mockLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
Loading