33var Constants = require ( '../util/Constants' ) ;
44const ExternalLoggerWrapper = require ( '../logging/ExternalLoggerWrapper' ) ;
55const ApiException = require ( '../util/ApiException' ) ;
6+ const fs = require ( "fs" ) ;
7+ const path = require ( "path" ) ;
68
79class LogConfiguration {
810 enableLog ;
@@ -12,8 +14,8 @@ class LogConfiguration {
1214 loggingLevel ;
1315 maxLogFiles ;
1416 enableMasking ;
17+ hasExternalLogger ;
1518 externalLogger ;
16- externalLoggerObj ;
1719
1820 constructor ( logConfig ) {
1921 this . setLogEnable ( logConfig . enableLog ) ;
@@ -23,8 +25,8 @@ class LogConfiguration {
2325 this . setLoggingLevel ( logConfig . loggingLevel ) ;
2426 this . setMaxLogFiles ( logConfig . maxLogFiles ) ;
2527 this . setMaskingEnabled ( logConfig . enableMasking ) ;
28+ this . setHasExternalLogger ( logConfig . hasExternalLogger ) ;
2629 this . setExternalLogger ( logConfig . externalLogger ) ;
27- this . setExternalLoggerObj ( logConfig . externalLoggerObj ) ;
2830 }
2931
3032 isLogEnabled ( ) {
@@ -49,20 +51,20 @@ class LogConfiguration {
4951 this . enableMasking = enableMaskingValue ;
5052 }
5153
52- setExternalLogger ( externalLogger ) {
53- this . externalLogger = externalLogger ;
54+ setHasExternalLogger ( hasExternalLogger ) {
55+ this . hasExternalLogger = hasExternalLogger ;
5456 }
5557
5658 isExternalLoggerSet ( ) {
57- return this . externalLogger ;
59+ return this . hasExternalLogger ;
5860 }
5961
60- setExternalLoggerObj ( externalLoggerObj ) {
61- this . externalLoggerObj = externalLoggerObj ;
62+ setExternalLogger ( externalLogger ) {
63+ this . externalLogger = externalLogger ;
6264 }
6365
64- getExternalLoggerObj ( ) {
65- return this . externalLoggerObj ;
66+ getExternalLogger ( ) {
67+ return this . externalLogger ;
6668 }
6769
6870 getLogDirectory ( ) {
@@ -122,16 +124,16 @@ class LogConfiguration {
122124
123125 getDefaultLoggingProperties ( warningMessage ) {
124126
125- if ( typeof ( this . externalLogger ) === "boolean" && this . externalLogger === true ) {
126- this . externalLogger = true ;
127+ if ( typeof ( this . hasExternalLogger ) === "boolean" && this . hasExternalLogger === true ) {
128+ this . hasExternalLogger = true ;
127129 } else {
128- this . externalLogger = false ;
130+ this . hasExternalLogger = false ;
129131 }
130132
131- if ( typeof ( this . externalLoggerObj ) === "Object" || ! ( this . externalLoggerObj instanceof ExternalLoggerWrapper )
132- && this . externalLoggerObj === undefined || ! ( this . externalLoggerObj . isLoggerEmpty ( ) ) ) {
133+ if ( ( typeof ( this . externalLogger ) === "object" && ! ( this . externalLogger instanceof ExternalLoggerWrapper ) )
134+ || this . externalLogger === undefined || ! ( this . externalLogger . isLoggerEmpty ( ) ) ) {
133135 ApiException . LoggerException ( "No valid external logger object found. Turning off external logger flag." )
134- this . externalLogger = false ;
136+ this . hasExternalLogger = false ;
135137 }
136138
137139 if ( typeof ( this . enableLog ) === "boolean" && this . enableLog === true ) {
0 commit comments