Change order of trace source in error log (#7599)

Change the order of trace source that gets
printed on the console.
master
kannappanr 6 years ago committed by Harshavardhana
parent ba76cd3268
commit a436f2baa5
  1. 5
      cmd/logger/target/console/console.go

@ -45,12 +45,13 @@ func (c *Target) Send(e interface{}) error {
return nil 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 // Add a sequence number and formatting for each stack trace
// No formatting is required for the first entry // No formatting is required for the first entry
for i, element := range entry.Trace.Source { 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 := "" tagString := ""

Loading…
Cancel
Save