From 1ccee1738d6c305d063b7cab6a89e7529f1a47cd Mon Sep 17 00:00:00 2001 From: Matthias Rampke <mr@soundcloud.com> Date: Thu, 18 Jan 2018 09:26:15 +0000 Subject: [PATCH] Print log lines as string, not single bytes Using %s coerces the byte array into a string, which makes it much more readable. --- exporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter.go b/exporter.go index 3fd1cb6..92acdc2 100644 --- a/exporter.go +++ b/exporter.go @@ -140,7 +140,7 @@ func (re *rsyslogExporter) run() { for re.scanner.Scan() { err := re.handleStatLine(re.scanner.Bytes()) if err != nil { - log.Printf("error handling stats line: %v, line was: %v", err, re.scanner.Bytes()) + log.Printf("error handling stats line: %v, line was: %s", err, re.scanner.Bytes()) } } if err := re.scanner.Err(); err != nil { -- GitLab