@@ -3,24 +3,6 @@ import { DEBUG_BUILD } from '../debug-build';
33import type { ConsoleLevel } from '../types-hoist/instrument' ;
44import { GLOBAL_OBJ } from './worldwide' ;
55
6- /**
7- * A Sentry Logger instance.
8- *
9- * @deprecated Use {@link debug} instead with the {@link SentryDebugLogger} type.
10- */
11- export interface Logger {
12- disable ( ) : void ;
13- enable ( ) : void ;
14- isEnabled ( ) : boolean ;
15- log ( ...args : Parameters < typeof console . log > ) : void ;
16- info ( ...args : Parameters < typeof console . info > ) : void ;
17- warn ( ...args : Parameters < typeof console . warn > ) : void ;
18- error ( ...args : Parameters < typeof console . error > ) : void ;
19- debug ( ...args : Parameters < typeof console . debug > ) : void ;
20- assert ( ...args : Parameters < typeof console . assert > ) : void ;
21- trace ( ...args : Parameters < typeof console . trace > ) : void ;
22- }
23-
246export interface SentryDebugLogger {
257 disable ( ) : void ;
268 enable ( ) : void ;
@@ -115,18 +97,6 @@ function error(...args: Parameters<typeof console.error>): void {
11597 _maybeLog ( 'error' , ...args ) ;
11698}
11799
118- function _debug ( ...args : Parameters < typeof console . debug > ) : void {
119- _maybeLog ( 'debug' , ...args ) ;
120- }
121-
122- function assert ( ...args : Parameters < typeof console . assert > ) : void {
123- _maybeLog ( 'assert' , ...args ) ;
124- }
125-
126- function trace ( ...args : Parameters < typeof console . trace > ) : void {
127- _maybeLog ( 'trace' , ...args ) ;
128- }
129-
130100function _maybeLog ( level : ConsoleLevel , ...args : Parameters < ( typeof console ) [ typeof level ] > ) : void {
131101 if ( ! DEBUG_BUILD ) {
132102 return ;
@@ -147,36 +117,6 @@ function _getLoggerSettings(): { enabled: boolean } {
147117 return getGlobalSingleton ( 'loggerSettings' , ( ) => ( { enabled : false } ) ) ;
148118}
149119
150- /**
151- * This is a logger singleton which either logs things or no-ops if logging is not enabled.
152- * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK.
153- *
154- * @deprecated Use {@link debug} instead.
155- */
156- export const logger = {
157- /** Enable logging. */
158- enable,
159- /** Disable logging. */
160- disable,
161- /** Check if logging is enabled. */
162- isEnabled,
163- /** Log a message. */
164- log,
165- /** Log level info */
166- info,
167- /** Log a warning. */
168- warn,
169- /** Log an error. */
170- error,
171- /** Log a debug message. */
172- debug : _debug ,
173- /** Log an assertion. */
174- assert,
175- /** Log a trace. */
176- trace,
177- // eslint-disable-next-line deprecation/deprecation
178- } satisfies Logger ;
179-
180120/**
181121 * This is a logger singleton which either logs things or no-ops if logging is not enabled.
182122 */
0 commit comments