Skip to content

Commit

Permalink
Fix not getting experiment pod logs in the UI and format logs (#4732)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Baalekshan committed Jul 15, 2024
1 parent 374c76f commit 0eceb42
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chaoscenter/web/src/controllers/CustomStepLog/CustomStepLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ export default function CustomStepLogController({
<SimpleLogViewer
loading={loading}
data={
podLogs && podLogs?.getPodLog ? podLogs.getPodLog.log : error ? error.message : getString('logErrorMessage')
podLogs && podLogs?.getPodLog ? (() => {
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')
}
/>
);
Expand Down

0 comments on commit 0eceb42

Please sign in to comment.