From c768e5d205c66bba0c37fd4c6e2e2b5a4c5e47b7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 30 Oct 2018 18:24:03 -0700 Subject: [PATCH] uglify the logs So, it turns out js-ipfs-api is relying on the fact that go-ipfs spits out ndjson event logs. Furthermore, it turns out that ndjson is just generally easier to parse. Therefore, while pretty logs are pretty, I think it's best to leave this up to the client. --- log.go | 1 - tracer/recorder.go | 1 - 2 files changed, 2 deletions(-) diff --git a/log.go b/log.go index e570561fd2a6..ae0d41adf8ed 100644 --- a/log.go +++ b/log.go @@ -339,7 +339,6 @@ func (el *eventLogger) Event(ctx context.Context, event string, metadata ...Logg var buf bytes.Buffer encoder := json.NewEncoder(&buf) encoder.SetEscapeHTML(false) - encoder.SetIndent("", " ") err = encoder.Encode(accum) if err != nil { el.Errorf("ERROR FORMATTING EVENT ENTRY: %s", err) diff --git a/tracer/recorder.go b/tracer/recorder.go index 0107103564bd..f298d6397471 100644 --- a/tracer/recorder.go +++ b/tracer/recorder.go @@ -93,7 +93,6 @@ func (r *LoggableSpanRecorder) RecordSpan(span RawSpan) { var buf bytes.Buffer encoder := json.NewEncoder(&buf) encoder.SetEscapeHTML(false) - encoder.SetIndent("", " ") err := encoder.Encode(spanlog) if err != nil { fmt.Fprintf(os.Stderr, "ERROR FORMATTING SPAN ENTRY: %s\n", err)