From a436f2baa5dc8ffee107ea7e96dda1011bc26226 Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Mon, 29 Apr 2019 14:56:30 -0700 Subject: [PATCH] Change order of trace source in error log (#7599) Change the order of trace source that gets printed on the console. --- cmd/logger/target/console/console.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/logger/target/console/console.go b/cmd/logger/target/console/console.go index 4358104a9..65084e6bb 100644 --- a/cmd/logger/target/console/console.go +++ b/cmd/logger/target/console/console.go @@ -45,12 +45,13 @@ func (c *Target) Send(e interface{}) error { return nil } - trace := make([]string, len(entry.Trace.Source)) + traceLength := len(entry.Trace.Source) + trace := make([]string, traceLength) // Add a sequence number and formatting for each stack trace // No formatting is required for the first entry for i, element := range entry.Trace.Source { - trace[i] = fmt.Sprintf("%8v: %s", i+1, element) + trace[i] = fmt.Sprintf("%8v: %s", traceLength-i, element) } tagString := ""