NOTE
本页由仓库元数据、API reports 或示例目录生成;包名、export subpaths、TypeScript 声明和源码链接保留原文,便于与发布产物逐项核对。
声明内容来自仓库 API report,保留英文注释和 TypeScript 原文,便于与发布产物逐项核对。
@loggerjs/sentry API
Generated from packages/sentry/dist/**/*.d.ts. 源报告:api-reports/loggerjs-sentry.api.md.
index.d.ts
ts
import { type LoggerLevel, type Transport } from "@loggerjs/core";
export type SentrySeverity = "debug" | "error" | "fatal" | "info" | "log" | "warning";
export interface SentryLoggerLike {
trace?: (message: string, attributes?: Record<string, unknown>) => void;
debug?: (message: string, attributes?: Record<string, unknown>) => void;
info?: (message: string, attributes?: Record<string, unknown>) => void;
warn?: (message: string, attributes?: Record<string, unknown>) => void;
error?: (message: string, attributes?: Record<string, unknown>) => void;
fatal?: (message: string, attributes?: Record<string, unknown>) => void;
}
export interface SentryLike {
logger?: SentryLoggerLike;
addBreadcrumb?: (breadcrumb: {
type?: string;
category?: string;
level?: SentrySeverity;
message?: string;
data?: Record<string, unknown>;
}) => void;
captureException?: (exception: unknown, context?: Record<string, unknown>) => string | undefined;
captureMessage?: (message: string, context?: Record<string, unknown>) => string | undefined;
}
export interface SentryTransportOptions {
sentry: SentryLike;
name?: string;
minLevel?: LoggerLevel;
structuredLogs?: boolean;
breadcrumbs?: boolean;
captureErrors?: boolean;
captureMessages?: boolean;
eventLevel?: LoggerLevel;
}
export declare function sentryTransport(options: SentryTransportOptions): Transport;