X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=98c3f1cc7f27c9d42f35efdb82b19664a9a24975;hb=0d2cec7666c01396c8125a752341d5b716d12906;hp=9f423ce4157a61d5aa89f25e417dbf34765ad930;hpb=10d244c0aa14bb4839791eea27e1674d87ae4e20;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index 9f423ce4..98c3f1cc 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -59,14 +59,15 @@ export default class UIHttpServer extends AbstractUIServer { this.responseHandlers.delete(uuid); } else { logger.error( - `${this.logPrefix()} ${moduleName}.sendResponse: Response for unknown request: ${response}` + `${this.logPrefix(moduleName, 'sendResponse')} Response for unknown request: ${response}` ); } } - public logPrefix(modName?: string, methodName?: string): string { + public logPrefix(modName?: string, methodName?: string, prefixSuffix?: string): string { + const logMsgPrefix = prefixSuffix ? `UI HTTP Server ${prefixSuffix}` : 'UI HTTP Server'; const logMsg = - modName && methodName ? ` UI HTTP Server | ${modName}.${methodName}:` : ' UI HTTP Server |'; + modName && methodName ? ` ${logMsgPrefix} | ${modName}.${methodName}:` : ` ${logMsgPrefix} |`; return Utils.logPrefix(logMsg); } @@ -80,7 +81,7 @@ export default class UIHttpServer extends AbstractUIServer { const uuid = Utils.generateUUID(); this.responseHandlers.set(uuid, { procedureName, res }); try { - if (UIServiceUtils.isProtocolSupported(protocol, version) === false) { + if (UIServiceUtils.isProtocolAndVersionSupported(protocol, version) === false) { throw new BaseError(`Unsupported UI protocol version: '/${protocol}/${version}'`); } req.on('error', (error) => {