Skip to content

Commit

Permalink
Merge pull request cisco-open#107 from tiswanso/fix-logsink-addvalues
Browse files Browse the repository at this point in the history
Fix logsink addvalues
  • Loading branch information
Laci21 authored Jun 23, 2022
2 parents f33bcfd + d3d1ee9 commit e4fbb0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ func (log *logger) WithName(name string) Logger {

func (log *logger) WithValues(keysAndValues ...interface{}) Logger {
sink := log.sink.copyLogger()
for k, v := range keysAndValues {
sink.values[k] = v
}

sink.values = keysAndValues

return &logger{
level: log.level,
Expand Down
4 changes: 1 addition & 3 deletions pkg/logger/logsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ func (log *SpinnerLogSink) GetValues() []interface{} {
}

func (log *SpinnerLogSink) AddValues(keyAndValues []interface{}) {
for k, v := range keyAndValues {
log.values[k] = v
}
log.values = append(log.values, keyAndValues...)
}

func (log *SpinnerLogSink) AddName(name string) {
Expand Down

0 comments on commit e4fbb0a

Please # to comment.