Skip to content

Commit 0eceb42

Browse files
authored
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 <[email protected]> * made changes Signed-off-by: Baalekshan <[email protected]> * made changes Signed-off-by: Baalekshan <[email protected]> --------- Signed-off-by: Baalekshan <[email protected]> Signed-off-by: Baalekshan <[email protected]>
1 parent 374c76f commit 0eceb42

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ export default function CustomStepLogController({
6363
<SimpleLogViewer
6464
loading={loading}
6565
data={
66-
podLogs && podLogs?.getPodLog ? podLogs.getPodLog.log : error ? error.message : getString('logErrorMessage')
66+
podLogs && podLogs?.getPodLog ? (() => {
67+
try {
68+
return Object.entries(JSON.parse(podLogs.getPodLog.log))
69+
.map(([key, value]) => `${key}: ${value}`)
70+
.join('\n');
71+
} catch (e) {
72+
return podLogs.getPodLog.log;
73+
}
74+
})() : error ? error.message : getString('logErrorMessage')
6775
}
6876
/>
6977
);

0 commit comments

Comments
 (0)