Skip to content

Commit

Permalink
Undo changes in log.go
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsignalfx committed Mar 24, 2021
1 parent 2dd4e8b commit 729f746
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions internal/receiver/smartagentreceiver/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,23 @@ func (l *logrusToZap) unRedirect(src logrusKey, dst *zap.Logger) {
l.loggerMap[src] = keep
}

func (l *logrusToZap) loggerMapValue0(src logrusKey) (*zap.Logger, bool) {
l.mu.Lock()
defer l.mu.Unlock()

if l.loggerMap == nil {
return nil, false
}

loggers, inMap := l.loggerMap[src]

if len(loggers) > 0 {
return loggers[0], inMap
}

return nil, inMap
}

// Levels is a logrus.Hook implementation that returns all logrus logging levels.
func (l *logrusToZap) Levels() []logrus.Level {
return logrus.AllLevels
Expand Down Expand Up @@ -225,20 +242,3 @@ func (l *logrusToZap) Fire(e *logrus.Entry) error {

return nil
}

func (l *logrusToZap) loggerMapValue0(src logrusKey) (*zap.Logger, bool) {
l.mu.Lock()
defer l.mu.Unlock()

if l.loggerMap == nil {
return nil, false
}

loggers, inMap := l.loggerMap[src]

if len(loggers) > 0 {
return loggers[0], inMap
}

return nil, inMap
}

0 comments on commit 729f746

Please sign in to comment.