From 0eceb42eb89ceb5fa4d4b06ef0e29c8ba68c818d Mon Sep 17 00:00:00 2001 From: Baalekshan <69910615+Baalekshan@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:04:32 +0530 Subject: [PATCH] Fix not getting experiment pod logs in the UI and format logs (#4732) * fix: Not getting experiment pod logs in the UI during experiment execution Signed-off-by: Baalekshan * made changes Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com> * made changes Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com> --------- Signed-off-by: Baalekshan Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com> --- .../src/controllers/CustomStepLog/CustomStepLog.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx b/chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx index 5cf94885ac6..5da75845fc3 100644 --- a/chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx +++ b/chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx @@ -63,7 +63,15 @@ export default function CustomStepLogController({ { + try { + return Object.entries(JSON.parse(podLogs.getPodLog.log)) + .map(([key, value]) => `${key}: ${value}`) + .join('\n'); + } catch (e) { + return podLogs.getPodLog.log; + } + })() : error ? error.message : getString('logErrorMessage') } /> );