diff --git a/format.go b/format.go index 3468f30..93198c6 100644 --- a/format.go +++ b/format.go @@ -108,7 +108,9 @@ func logfmt(buf *bytes.Buffer, ctx []interface{}, color int) { if color > 0 { fmt.Fprintf(buf, "\x1b[%dm%s\x1b[0m=%s", color, k, v) } else { - fmt.Fprintf(buf, "%s=%s", k, v) + buf.WriteString(k) + buf.WriteByte('=') + buf.WriteString(v) } } diff --git a/log15_test.go b/log15_test.go index 49106b5..baee660 100644 --- a/log15_test.go +++ b/log15_test.go @@ -254,14 +254,13 @@ func TestNetHandler(t *testing.T) { go func() { c, err := l.Accept() if err != nil { - t.Errorf("Failed to accept conneciton: %v", err) - return + t.Fatalf("Failed to accept connection: %v", err) } rd := bufio.NewReader(c) s, err := rd.ReadString('\n') if err != nil { - t.Errorf("Failed to read string: %v", err) + t.Fatalf("Failed to read string: %v", err) } got := s[27:]