Merge dependabot/npm_and_yarn/typescript-eslint/parser-6.7.5 into combined-prs-branch
[e-mobility-charging-stations-simulator.git] / src / charging-station / Helpers.ts
index 068bc6c970afeaa9e402cc4f69086ccafae59ded..99a8f82cb5dca431de4f3c6f49ca044129f16c7e 100644 (file)
@@ -1,6 +1,7 @@
 import { createHash, randomBytes } from 'node:crypto';
 import type { EventEmitter } from 'node:events';
 import { basename, dirname, join } from 'node:path';
+import { env } from 'node:process';
 import { fileURLToPath } from 'node:url';
 
 import chalk from 'chalk';
@@ -76,7 +77,7 @@ export const getChargingStationId = (
   stationTemplate: ChargingStationTemplate,
 ): string => {
   // In case of multiple instances: add instance index to charging station id
-  const instanceIndex = process.env.CF_INSTANCE_INDEX ?? 0;
+  const instanceIndex = env.CF_INSTANCE_INDEX ?? 0;
   const idSuffix = stationTemplate?.nameSuffix ?? '';
   const idStr = `000000000${index.toString()}`;
   return stationTemplate?.fixedName
@@ -714,7 +715,7 @@ const warnDeprecatedTemplateKey = (
       isNotEmptyString(logMsgToAppend) ? `. ${logMsgToAppend}` : ''
     }`;
     logger.warn(`${logPrefix} ${logMsg}`);
-    console.warn(chalk.yellow(`${logMsg}`));
+    console.warn(`${chalk.green(logPrefix)} ${chalk.yellow(logMsg)}`);
   }
 };