feat!: API options object support to control sentry handling; removal of logger.sentry.
# Conflicts: # README.md # src/logger.ts # src/sinks/sentry.ts # test/logger.test.ts
This commit is contained in:
+1
-3
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user