UI Protocol: Build response with the global excecution status on each
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIHttpServer.ts
index de4061106619d4985365d778ee959547fa080c6b..98c3f1cc7f27c9d42f35efdb82b19664a9a24975 100644 (file)
@@ -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);
   }