diff --git a/klog.go b/klog.go index a2e73951..907b44cf 100644 --- a/klog.go +++ b/klog.go @@ -878,7 +878,7 @@ func writeStringValue(b *bytes.Buffer, quote bool, v string) { // Complex multi-line string, show as-is with indention. b.WriteString(">>>\n") for index != -1 { - b.WriteByte(' ') + b.WriteByte('\t') b.Write(data[0 : index+1]) data = data[index+1:] index = bytes.IndexByte(data, '\n') @@ -889,7 +889,7 @@ func writeStringValue(b *bytes.Buffer, quote bool, v string) { } else { // No line break at end of last line, write rest of string and // add one. - b.WriteByte(' ') + b.WriteByte('\t') b.Write(data) b.WriteString("\n <<<") } diff --git a/klog_test.go b/klog_test.go index 0debdb50..f6593eaa 100644 --- a/klog_test.go +++ b/klog_test.go @@ -973,8 +973,8 @@ with a line break.`, msg: `first message line second message line`, format: `I0102 15:04:05.067890 1234 klog_test.go:%d] "first message line\nsecond message line" multiLine>>> - first value line - second value line + first value line + second value line <<< `, keysValues: []interface{}{"multiLine", `first value line @@ -983,8 +983,8 @@ second value line`}, { msg: `message`, format: `I0102 15:04:05.067890 1234 klog_test.go:%d] "message" myData>>> - {Data:This is some long text - with a line break.} + {Data:This is some long text + with a line break.} <<< `, keysValues: []interface{}{"myData", myData}, @@ -1109,10 +1109,10 @@ No whitespace.`, "pod", "kubedns", }, want: ` multiLineString>>> - Hello world! - Starts with tab. - Starts with spaces. - No whitespace. + Hello world! + Starts with tab. + Starts with spaces. + No whitespace. <<< pod="kubedns"`, }, {