From bc061d3086e5f7ee7a9b02708646383ab9466409 Mon Sep 17 00:00:00 2001 From: Ken Kunz Date: Tue, 19 Sep 2023 12:51:01 -0500 Subject: [PATCH] display strategy error traceback when available --- .../(nav)/logs/LogEntriesList.svelte | 6 +-- .../[strategy]/(nav)/logs/LogEntry.svelte | 39 ++++++++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/routes/strategies/[strategy]/(nav)/logs/LogEntriesList.svelte b/src/routes/strategies/[strategy]/(nav)/logs/LogEntriesList.svelte index 45f6499b4..3253a0a35 100644 --- a/src/routes/strategies/[strategy]/(nav)/logs/LogEntriesList.svelte +++ b/src/routes/strategies/[strategy]/(nav)/logs/LogEntriesList.svelte @@ -10,9 +10,9 @@ Display log messages as a scrollable panel
- - {#each [...logs].reverse() as { timestamp, level, message }} - + + {#each [...logs].reverse() as { timestamp, level, message, formatted_data }} + {/each}
diff --git a/src/routes/strategies/[strategy]/(nav)/logs/LogEntry.svelte b/src/routes/strategies/[strategy]/(nav)/logs/LogEntry.svelte index d223a82fb..7d568e79a 100644 --- a/src/routes/strategies/[strategy]/(nav)/logs/LogEntry.svelte +++ b/src/routes/strategies/[strategy]/(nav)/logs/LogEntry.svelte @@ -4,13 +4,23 @@ export let timestamp: number; export let level: 'info' | 'trade' | 'warning' | 'error' | 'critical'; export let message: string; + export let formatted_data: Maybe = undefined;
- +
{message} - + {#if formatted_data?.length} +
+ + {formatted_data[0].trimEnd()} + ({formatted_data.length - 1} lines) + + {formatted_data.slice(1).join('')} +
+ {/if} +