Skip to content

Commit

Permalink
Ignore duplicate start events in simple renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Aug 17, 2020
1 parent 90a624f commit e2dbf33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion renderers/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ func (r SimpleRenderer) RenderScopeStarted(entry *echelon.LogScopeStarted) {
if level == 0 {
return
}
r.startTimes[strings.Join(scopes, "/")] = time.Now()
timeKey := strings.Join(scopes, "/")
if _, ok := r.startTimes[timeKey]; ok {
// duplicate event
return
}
r.startTimes[timeKey] = time.Now()
lastScope := scopes[level-1]
message := terminal.GetColoredText(r.colors.NeutralColor, fmt.Sprintf("Started '%s'", lastScope))
r.renderEntry(message)
Expand Down

0 comments on commit e2dbf33

Please sign in to comment.