File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 44 BasicLogger ,
55 LDClient as CommonClient ,
66 Configuration ,
7+ createSafeLogger ,
78 Encoding ,
89 FlagManager ,
910 internal ,
@@ -52,12 +53,18 @@ export class BrowserClient extends LDClientImpl {
5253 overridePlatform ?: Platform ,
5354 ) {
5455 const { logger : customLogger , debug } = options ;
56+ // Overrides the default logger from the common implementation.
5557 const logger =
5658 customLogger ??
57- new BasicLogger ( {
58- level : debug ? 'debug' : 'info' ,
59+ createSafeLogger ( {
5960 // eslint-disable-next-line no-console
60- destination : console . log ,
61+ debug : debug ? console . debug : ( ) => { } ,
62+ // eslint-disable-next-line no-console
63+ info : console . info ,
64+ // eslint-disable-next-line no-console
65+ warn : console . warn ,
66+ // eslint-disable-next-line no-console
67+ error : console . error ,
6168 } ) ;
6269
6370 // TODO: Use the already-configured baseUri from the SDK config. SDK-560
@@ -70,7 +77,7 @@ export class BrowserClient extends LDClientImpl {
7077 clientSideId ,
7178 autoEnvAttributes ,
7279 platform ,
73- filterToBaseOptions ( options ) ,
80+ filterToBaseOptions ( { ... options , logger } ) ,
7481 (
7582 flagManager : FlagManager ,
7683 configuration : Configuration ,
Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ export default class BrowserDataManager extends BaseDataManager {
117117 }
118118
119119 private stopDataSource ( ) {
120+ if ( this . updateProcessor ) {
121+ this . debugLog ( 'Stopping update processor.' ) ;
122+ }
120123 this . updateProcessor ?. close ( ) ;
121124 this . updateProcessor = undefined ;
122125 }
You can’t perform that action at this time.
0 commit comments