File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-explicit-any */
22import { WrappedFunction } from '@sentry/types' ;
33
4+ import { isDebugBuild } from './env' ;
45import { getGlobalObject } from './global' ;
56
67// TODO: Implement different loggers for different environments
@@ -104,8 +105,13 @@ class Logger {
104105 }
105106}
106107
107- // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
108- global . __SENTRY__ = global . __SENTRY__ || { } ;
109- const logger = ( global . __SENTRY__ . logger as Logger ) || ( global . __SENTRY__ . logger = new Logger ( ) ) ;
108+ const sentryGlobal = global . __SENTRY__ || { } ;
109+ const logger = ( sentryGlobal . logger as Logger ) || new Logger ( ) ;
110+
111+ if ( isDebugBuild ( ) ) {
112+ // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
113+ sentryGlobal . logger = logger ;
114+ global . __SENTRY__ = sentryGlobal ;
115+ }
110116
111117export { logger } ;
You can’t perform that action at this time.
0 commit comments