feat(core-shared): add ILogger interface + NoopLogger

This commit is contained in:
2026-05-06 23:41:27 +02:00
parent f1051ded9b
commit fdd4e9141b
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
export type Breadcrumb = {
category: string;
message: string;
level?: "info" | "warning" | "error";
data?: Record<string, unknown>;
};
export type CaptureContext = {
tags?: Record<string, string>;
extras?: Record<string, unknown>;
fingerprint?: string[];
};
export interface ILogger {
captureException(err: unknown, ctx?: CaptureContext): void;
captureMessage(
msg: string,
level?: "info" | "warning" | "error",
ctx?: CaptureContext,
): void;
addBreadcrumb(b: Breadcrumb): void;
setUser(user: { id: string } | null): void;
}