Merge pull request #11694 from ilya-zuyev/fix_box_intersection
Fix intersected log boxes when running with --alsologtostderrpull/11709/head
commit
f068befb3d
|
@ -114,17 +114,12 @@ func Styled(st style.Enum, format string, a ...V) {
|
|||
}
|
||||
|
||||
func boxedCommon(printFunc func(format string, a ...interface{}), format string, a ...V) {
|
||||
str := Sprintf(style.None, format, a...)
|
||||
str = strings.TrimSpace(str)
|
||||
box := box.New(box.Config{Py: 1, Px: 4, Type: "Round"})
|
||||
if useColor {
|
||||
box.Config.Color = "Red"
|
||||
}
|
||||
str = box.String("", str)
|
||||
lines := strings.Split(str, "\n")
|
||||
for _, line := range lines {
|
||||
printFunc(line + "\n")
|
||||
}
|
||||
str := Sprintf(style.None, format, a...)
|
||||
printFunc(box.String("", strings.TrimSpace(str)))
|
||||
}
|
||||
|
||||
// Boxed writes a stylized and templated message in a box to stdout
|
||||
|
|
Loading…
Reference in New Issue