From 489b8412951794fa0fa03b8989dd5c9789c684a8 Mon Sep 17 00:00:00 2001 From: Richard Hull Date: Sun, 25 Sep 2022 15:35:29 +0100 Subject: [PATCH] Add a closing tag when showing timestamp in log view (#1776) --- internal/dao/log_item.go | 1 + internal/dao/log_item_test.go | 2 +- internal/dao/log_items_test.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/dao/log_item.go b/internal/dao/log_item.go index bdce7b08..a66e1748 100644 --- a/internal/dao/log_item.go +++ b/internal/dao/log_item.go @@ -73,6 +73,7 @@ func (l *LogItem) Render(paint string, showTime bool, bb *bytes.Buffer) { for i := len(l.Bytes[:index]); i < 30; i++ { bb.WriteByte(' ') } + bb.WriteString("[-::]") } if l.Pod != "" { diff --git a/internal/dao/log_item_test.go b/internal/dao/log_item_test.go index ac9632b7..1eeacc54 100644 --- a/internal/dao/log_item_test.go +++ b/internal/dao/log_item_test.go @@ -63,7 +63,7 @@ func TestLogItemRender(t *testing.T) { ShowTimestamp: true, }, log: fmt.Sprintf("%s %s\n", "2018-12-14T10:36:43.326972-07:00", "Testing 1,2,3..."), - e: "[gray::b]2018-12-14T10:36:43.326972-07:00 [yellow::]fred [yellow::b]blee[-::-] Testing 1,2,3...\n", + e: "[gray::b]2018-12-14T10:36:43.326972-07:00 [-::][yellow::]fred [yellow::b]blee[-::-] Testing 1,2,3...\n", }, "log-level": { opts: dao.LogOptions{ diff --git a/internal/dao/log_items_test.go b/internal/dao/log_items_test.go index ec491c10..e4e2742e 100644 --- a/internal/dao/log_items_test.go +++ b/internal/dao/log_items_test.go @@ -108,7 +108,7 @@ func TestLogItemsRender(t *testing.T) { Container: "blee", ShowTimestamp: true, }, - e: "[gray::b]2018-12-14T10:36:43.326972-07:00 [teal::]fred [teal::b]blee[-::-] Testing 1,2,3...\n", + e: "[gray::b]2018-12-14T10:36:43.326972-07:00 [-::][teal::]fred [teal::b]blee[-::-] Testing 1,2,3...\n", }, }