1
+ import { logger } from '../application-logger' ;
1
2
import {
2
3
AssignmentCache ,
3
4
Cacheable ,
@@ -307,7 +308,7 @@ export default class EppoClient implements IEppoClient {
307
308
308
309
private rethrowIfNotGraceful ( err : Error , defaultValue ?: EppoValue ) : EppoValue {
309
310
if ( this . isGracefulFailureMode ) {
310
- console . error ( `[Eppo SDK] Error getting assignment: ${ err . message } ` ) ;
311
+ logger . error ( `[Eppo SDK] Error getting assignment: ${ err . message } ` ) ;
311
312
return defaultValue ?? EppoValue . Null ( ) ;
312
313
}
313
314
throw err ;
@@ -338,7 +339,7 @@ export default class EppoClient implements IEppoClient {
338
339
const flag = this . getFlag ( flagKey ) ;
339
340
340
341
if ( flag === null ) {
341
- console . warn ( `[Eppo SDK] No assigned variation. Flag not found: ${ flagKey } ` ) ;
342
+ logger . warn ( `[Eppo SDK] No assigned variation. Flag not found: ${ flagKey } ` ) ;
342
343
// note: this is different from the Python SDK, which returns None instead
343
344
return noneResult ( flagKey , subjectKey , subjectAttributes ) ;
344
345
}
@@ -350,7 +351,7 @@ export default class EppoClient implements IEppoClient {
350
351
}
351
352
352
353
if ( ! flag . enabled ) {
353
- console . info ( `[Eppo SDK] No assigned variation. Flag is disabled: ${ flagKey } ` ) ;
354
+ logger . info ( `[Eppo SDK] No assigned variation. Flag is disabled: ${ flagKey } ` ) ;
354
355
// note: this is different from the Python SDK, which returns None instead
355
356
return noneResult ( flagKey , subjectKey , subjectAttributes ) ;
356
357
}
@@ -375,7 +376,7 @@ export default class EppoClient implements IEppoClient {
375
376
this . logAssignment ( result ) ;
376
377
}
377
378
} catch ( error ) {
378
- console . error ( `[Eppo SDK] Error logging assignment event: ${ error } ` ) ;
379
+ logger . error ( `[Eppo SDK] Error logging assignment event: ${ error } ` ) ;
379
380
}
380
381
381
382
return result ;
@@ -445,7 +446,7 @@ export default class EppoClient implements IEppoClient {
445
446
this . assignmentLogger ?. logAssignment ( event ) ;
446
447
}
447
448
} catch ( error ) {
448
- console . error ( `[Eppo SDK] Error flushing assignment events: ${ error . message } ` ) ;
449
+ logger . error ( `[Eppo SDK] Error flushing assignment events: ${ error . message } ` ) ;
449
450
}
450
451
}
451
452
@@ -493,7 +494,7 @@ export default class EppoClient implements IEppoClient {
493
494
variationKey : result . variation ?. key ?? '__eppo_no_variation' ,
494
495
} ) ;
495
496
} catch ( error ) {
496
- console . error ( `[Eppo SDK] Error logging assignment event: ${ error . message } ` ) ;
497
+ logger . error ( `[Eppo SDK] Error logging assignment event: ${ error . message } ` ) ;
497
498
}
498
499
}
499
500
}
0 commit comments