repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: refine OCPP stack log message
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
ErrorUtils.ts
diff --git
a/src/utils/ErrorUtils.ts
b/src/utils/ErrorUtils.ts
index fea221e4fc4f371688a1d33960cc7cbd36d6219b..537aa308b41a0516e4b688c7f9b38124952d455f 100644
(file)
--- a/
src/utils/ErrorUtils.ts
+++ b/
src/utils/ErrorUtils.ts
@@
-1,3
+1,5
@@
+import process from 'node:process';
+
import chalk from 'chalk';
import { logger } from './Logger';
import chalk from 'chalk';
import { logger } from './Logger';
@@
-56,10
+58,11
@@
export const handleFileException = (
logMsg = `${fileType} file ${file} error:`;
}
if (params?.consoleOut === true) {
logMsg = `${fileType} file ${file} error:`;
}
if (params?.consoleOut === true) {
+ logMsg = `${logMsg} `;
if (params?.throwError) {
if (params?.throwError) {
- console.error(`${chalk.green(prefix)}${chalk.red(
`${logMsg} `
)}`, error);
+ console.error(`${chalk.green(prefix)}${chalk.red(
logMsg
)}`, error);
} else {
} else {
- console.warn(`${chalk.green(prefix)}${chalk.yellow(
`${logMsg} `
)}`, error);
+ console.warn(`${chalk.green(prefix)}${chalk.yellow(
logMsg
)}`, error);
}
} else if (params?.consoleOut === false) {
if (params?.throwError) {
}
} else if (params?.consoleOut === false) {
if (params?.throwError) {