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

Revert "refactor(telemetry-utlis): Make MockLogger internal" #23035

Merged
merged 1 commit into from
Nov 11, 2024
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: 0 additions & 13 deletions .changeset/green-readers-burn.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ 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: 22 additions & 1 deletion packages/utils/telemetry-utils/src/mockLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
Loading