feat: closed box with right wall and padded rows
This commit is contained in:
1 parent
ef0dc08bcd
commit
c0a47bc99b
2 files changed
+25
-26
No files matched your search
@@ -737,17 +737,16 @@ func renderBox(head string, groups []logGroup) {
|
||||
}
|
||||
}
|
||||
ts := time.Now().Format("02.01.2006 15:04:05")
|
||||
top := "┌─ " + ts + " "
|
||||
if runeCount(top) < width {
|
||||
top += strings.Repeat("─", width-runeCount(top))
|
||||
} else {
|
||||
width = runeCount(top)
|
||||
base := "┌─ " + ts + " "
|
||||
if width < runeCount(base) {
|
||||
width = runeCount(base)
|
||||
}
|
||||
logRaw(top)
|
||||
// Закрытый бокс: правая стенка у каждой строки.
|
||||
logRaw(base + strings.Repeat("─", width-runeCount(base)) + "┐")
|
||||
for _, line := range lines {
|
||||
logRaw(line)
|
||||
logRaw(line + strings.Repeat(" ", width-runeCount(line)) + "│")
|
||||
}
|
||||
logRaw("└" + strings.Repeat("─", width-1))
|
||||
logRaw("└" + strings.Repeat("─", width-1) + "┘")
|
||||
logRaw("")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user