feat: move logging configuration into its own section
[e-mobility-charging-stations-simulator.git] / src / performance / PerformanceStatistics.ts
index 565ef6e7a2e4126a6fcc7e7e8e6c7c6f0f6cef8a..a111eb450e66dcfb88e036977db48ee0dd351f21 100644 (file)
@@ -165,7 +165,9 @@ export class PerformanceStatistics {
   }
 
   private startLogStatisticsInterval(): void {
-    const logStatisticsInterval = Configuration.getLogStatisticsInterval();
+    const logStatisticsInterval = Configuration.getLog().enabled
+      ? Configuration.getLog().statisticsInterval
+      : 0;
     if (logStatisticsInterval > 0 && !this.displayInterval) {
       this.displayInterval = setInterval(() => {
         this.logStatistics();
@@ -179,7 +181,7 @@ export class PerformanceStatistics {
           logStatisticsInterval
         )}`
       );
-    } else {
+    } else if (Configuration.getLog().enabled) {
       logger.info(
         `${this.logPrefix()} log interval is set to ${logStatisticsInterval?.toString()}. Not logging statistics`
       );