X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FFileUtils.ts;h=10317c7353f4855a4a0f24ecb42d809b5f0b1f03;hb=5612b691da864fc2822629bbee32ed8008ee6472;hp=e36e85f73f5b11393899e4f8f9d83cf36dd346e5;hpb=d5bd1c008c3b2fbe6426ae12e1e12afe97807c57;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts index e36e85f7..10317c73 100644 --- a/src/utils/FileUtils.ts +++ b/src/utils/FileUtils.ts @@ -1,11 +1,13 @@ +import fs from 'fs'; + +import chalk from 'chalk'; + import { EmptyObject } from '../types/EmptyObject'; -import { FileType } from '../types/FileType'; import { HandleErrorParams } from '../types/Error'; +import { FileType } from '../types/FileType'; import { JsonType } from '../types/JsonType'; -import Utils from './Utils'; -import chalk from 'chalk'; -import fs from 'fs'; import logger from './Logger'; +import Utils from './Utils'; export default class FileUtils { private constructor() { @@ -58,7 +60,7 @@ export default class FileUtils { error ); } else { - logger.warn(prefix + fileType + ' file ' + file + ' not found: %j', error); + logger.warn(prefix + fileType + ' file ' + file + ' not found:', error); } } else if (error.code === 'EEXIST') { if (params?.consoleOut) { @@ -67,7 +69,7 @@ export default class FileUtils { error ); } else { - logger.warn(prefix + fileType + ' file ' + file + ' already exists: %j', error); + logger.warn(prefix + fileType + ' file ' + file + ' already exists:', error); } } else if (error.code === 'EACCES') { if (params?.consoleOut) { @@ -76,7 +78,7 @@ export default class FileUtils { error ); } else { - logger.warn(prefix + fileType + ' file ' + file + ' access denied: %j', error); + logger.warn(prefix + fileType + ' file ' + file + ' access denied:', error); } } else { if (params?.consoleOut) { @@ -85,7 +87,7 @@ export default class FileUtils { error ); } else { - logger.warn(prefix + fileType + ' file ' + file + ' error: %j', error); + logger.warn(prefix + fileType + ' file ' + file + ' error:', error); } if (params?.throwError) { throw error;