feat!: API options object support to control sentry handling; removal of logger.sentry.
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

# Conflicts:
#	README.md
#	src/logger.ts
#	src/sinks/sentry.ts
#	test/logger.test.ts
This commit is contained in:
2026-08-07 12:10:38 -03:00
parent 6bee3a801d
commit 234226e2bb
5 changed files with 16 additions and 20 deletions
+1 -3
View File
@@ -196,9 +196,7 @@ function resolveSentrySinkOptions(
options: LoggerOptions,
): { logs: boolean; logLevel: LogLevel } | undefined {
if (options.environment === "development") return undefined;
const candidate = options.sentry
? options.sentry
: options.sinks?.find(isSentrySinkLike);
const candidate = options.sentry ? options.sentry : options.sinks?.find(isSentrySinkLike);
if (!candidate) return undefined;
if (isSentrySinkLike(candidate)) {
return {
+1 -4
View File
@@ -165,10 +165,7 @@ export function toSentryLogPayload(event: LogEvent): {
* logger.error("expected", err, { suppressSentry: true });
* ```
*/
export function createSentrySink(
sentry: SentryLike,
options: SentrySinkOptions = {},
): SentrySink {
export function createSentrySink(sentry: SentryLike, options: SentrySinkOptions = {}): SentrySink {
return {
kind: "sentry",
options,