Ensure 1:1 mapping between charging station instance and its OCPP services
[e-mobility-charging-stations-simulator.git] / src / utils / FileUtils.ts
index c6850c7103d47e9f05053fc8afaaefde961a9fcd..e68500e33b5821a2dc5d9f5876949b7d3ac28d9f 100644 (file)
@@ -1,5 +1,5 @@
 import chalk from 'chalk';
-import getLogger from './Logger';
+import logger from './Logger';
 
 export default class FileUtils {
   static handleFileException(logPrefix: string, fileType: string, filePath: string, error: NodeJS.ErrnoException, consoleOut = false): void {
@@ -8,25 +8,25 @@ export default class FileUtils {
       if (consoleOut) {
         console.warn(chalk.green(prefix) + chalk.yellow(fileType + ' file ' + filePath + ' not found: '), error);
       } else {
-        getLogger().warn(prefix + fileType + ' file ' + filePath + ' not found: %j', error);
+        logger.warn(prefix + fileType + ' file ' + filePath + ' not found: %j', error);
       }
     } else if (error.code === 'EEXIST') {
       if (consoleOut) {
         console.warn(chalk.green(prefix) + chalk.yellow(fileType + ' file ' + filePath + ' already exists: '), error);
       } else {
-        getLogger().warn(prefix + fileType + ' file ' + filePath + ' already exists: %j', error);
+        logger.warn(prefix + fileType + ' file ' + filePath + ' already exists: %j', error);
       }
     } else if (error.code === 'EACCES') {
       if (consoleOut) {
         console.warn(chalk.green(prefix) + chalk.yellow(fileType + ' file ' + filePath + ' access denied: '), error);
       } else {
-        getLogger().warn(prefix + fileType + ' file ' + filePath + ' access denied: %j', error);
+        logger.warn(prefix + fileType + ' file ' + filePath + ' access denied: %j', error);
       }
     } else {
       if (consoleOut) {
         console.warn(chalk.green(prefix) + chalk.yellow(fileType + ' file ' + filePath + ' error: '), error);
       } else {
-        getLogger().warn(prefix + fileType + ' file ' + filePath + ' error: %j', error);
+        logger.warn(prefix + fileType + ' file ' + filePath + ' error: %j', error);
       }
       throw error;
     }