diff --git a/MIGRATION.md b/MIGRATION.md index e3e6f77437fa..ee1817f74bc2 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -36,7 +36,7 @@ Updates and fixes for version 9 will be published as `SentryNodeServerlessSDKv9` ### `@sentry/core` / All SDKs -- TODO: fill in removed APIs +- `logger` and type `Logger` were removed, use `debug` and type `SentryDebugLogger` instead. ## No Version Support Timeline diff --git a/packages/core/src/carrier.ts b/packages/core/src/carrier.ts index 9fde3f7b74f0..a050f2235af5 100644 --- a/packages/core/src/carrier.ts +++ b/packages/core/src/carrier.ts @@ -3,7 +3,7 @@ import type { AsyncContextStrategy } from './asyncContext/types'; import type { Client } from './client'; import type { Scope } from './scope'; import type { SerializedLog } from './types-hoist/log'; -import type { Logger } from './utils/debug-logger'; +import type { SentryDebugLogger } from './utils/debug-logger'; import { SDK_VERSION } from './utils/version'; import { GLOBAL_OBJ } from './utils/worldwide'; @@ -26,9 +26,7 @@ export interface SentryCarrier { globalScope?: Scope; defaultIsolationScope?: Scope; defaultCurrentScope?: Scope; - /** @deprecated Logger is no longer set. Instead, we keep enabled state in loggerSettings. */ - // eslint-disable-next-line deprecation/deprecation - logger?: Logger; + logger?: SentryDebugLogger; loggerSettings?: { enabled: boolean }; /** * A map of Sentry clients to their log buffers. diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 3e020fc6aa77..89329c81be6a 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -167,10 +167,8 @@ export { isVueViewModel, } from './utils/is'; export { isBrowser } from './utils/isBrowser'; -// eslint-disable-next-line deprecation/deprecation -export { CONSOLE_LEVELS, consoleSandbox, debug, logger, originalConsoleMethods } from './utils/debug-logger'; -// eslint-disable-next-line deprecation/deprecation -export type { Logger, SentryDebugLogger } from './utils/debug-logger'; +export { CONSOLE_LEVELS, consoleSandbox, debug, originalConsoleMethods } from './utils/debug-logger'; +export type { SentryDebugLogger } from './utils/debug-logger'; export { addContextToFrame, addExceptionMechanism, diff --git a/packages/core/src/utils/debug-logger.ts b/packages/core/src/utils/debug-logger.ts index 36e3169b1d52..6a68c061fafb 100644 --- a/packages/core/src/utils/debug-logger.ts +++ b/packages/core/src/utils/debug-logger.ts @@ -3,24 +3,6 @@ import { DEBUG_BUILD } from '../debug-build'; import type { ConsoleLevel } from '../types-hoist/instrument'; import { GLOBAL_OBJ } from './worldwide'; -/** - * A Sentry Logger instance. - * - * @deprecated Use {@link debug} instead with the {@link SentryDebugLogger} type. - */ -export interface Logger { - disable(): void; - enable(): void; - isEnabled(): boolean; - log(...args: Parameters): void; - info(...args: Parameters): void; - warn(...args: Parameters): void; - error(...args: Parameters): void; - debug(...args: Parameters): void; - assert(...args: Parameters): void; - trace(...args: Parameters): void; -} - export interface SentryDebugLogger { disable(): void; enable(): void; @@ -147,36 +129,6 @@ function _getLoggerSettings(): { enabled: boolean } { return getGlobalSingleton('loggerSettings', () => ({ enabled: false })); } -/** - * This is a logger singleton which either logs things or no-ops if logging is not enabled. - * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK. - * - * @deprecated Use {@link debug} instead. - */ -export const logger = { - /** Enable logging. */ - enable, - /** Disable logging. */ - disable, - /** Check if logging is enabled. */ - isEnabled, - /** Log a message. */ - log, - /** Log level info */ - info, - /** Log a warning. */ - warn, - /** Log an error. */ - error, - /** Log a debug message. */ - debug: _debug, - /** Log an assertion. */ - assert, - /** Log a trace. */ - trace, - // eslint-disable-next-line deprecation/deprecation -} satisfies Logger; - /** * This is a logger singleton which either logs things or no-ops if logging is not enabled. */