From 729f7469c824711b4e61b1dd98b74be61413b972 Mon Sep 17 00:00:00 2001 From: Bremer Jonathan Date: Wed, 24 Mar 2021 17:51:15 -0400 Subject: [PATCH] Undo changes in log.go --- internal/receiver/smartagentreceiver/log.go | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/receiver/smartagentreceiver/log.go b/internal/receiver/smartagentreceiver/log.go index 9b7416f27d..203baed70a 100644 --- a/internal/receiver/smartagentreceiver/log.go +++ b/internal/receiver/smartagentreceiver/log.go @@ -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 @@ -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 -}