feat(logger): add explicit Sentry event channel
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
2026-08-05 13:05:06 -03:00
parent 0ccb7f911d
commit 44f471653e
7 changed files with 66 additions and 10 deletions
+16
View File
@@ -9,6 +9,10 @@ export interface LogEvent {
namespace?: string;
arguments: readonly unknown[];
timestamp: Date;
/** Whether this event was explicitly selected for Sentry capture. */
sendToSentry: boolean;
/** Whether the default console sink should render this event. */
sendToConsole: boolean;
}
/** A destination for enabled log events. */
@@ -33,8 +37,20 @@ export interface LoggerOptions {
sinks?: readonly LogSink[];
}
/** Explicit Sentry reporting methods. These bypass the logger's normal level threshold. */
export interface SentryLogger {
trace(...arguments_: readonly unknown[]): void;
debug(...arguments_: readonly unknown[]): void;
log(...arguments_: readonly unknown[]): void;
info(...arguments_: readonly unknown[]): void;
warn(...arguments_: readonly unknown[]): void;
error(...arguments_: readonly unknown[]): void;
}
export interface Logger {
readonly namespace?: string;
/** Sends selected events to a configured Sentry sink without changing the default policy for other logs. */
readonly sentry: SentryLogger;
child(namespace: string): Logger;
trace(...arguments_: readonly unknown[]): void;
debug(...arguments_: readonly unknown[]): void;