You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func TestSetReportCallerRace(t *testing.T) {
l := New()
l.Out = ioutil.Discard
l.SetReportCaller(true)
var wg sync.WaitGroup
wg.Add(100)
for i := 0; i < 100; i++ {
go func() {
l.Error("Some Error")
wg.Done()
}()
}
wg.Wait()
}
WARNING: DATA RACE
Read at 0x000000c75b98 by goroutine 14:
github.com/sirupsen/logrus.getCaller()
/home/georlav/other/logrus/entry.go:161 +0x7b
github.com/sirupsen/logrus.Entry.log()
/home/georlav/other/logrus/entry.go:210 +0x395
github.com/sirupsen/logrus.(*Entry).Log()
/home/georlav/other/logrus/entry.go:258 +0x154
github.com/sirupsen/logrus.(*Logger).Log()
/home/georlav/other/logrus/logger.go:184 +0xa4
github.com/sirupsen/logrus_test.TestSetReportCallerRace.func1()
/home/georlav/other/logrus/logger.go:216 +0x81
WARNING: DATA RACE
Read at 0x000000c75b98 by goroutine 14:
github.com/sirupsen/logrus.getCaller()
/home/georlav/other/logrus/entry.go:161 +0x7b
github.com/sirupsen/logrus.Entry.log()
/home/georlav/other/logrus/entry.go:210 +0x395
github.com/sirupsen/logrus.(*Entry).Log()
/home/georlav/other/logrus/entry.go:258 +0x154
github.com/sirupsen/logrus.(*Logger).Log()
/home/georlav/other/logrus/logger.go:184 +0xa4
github.com/sirupsen/logrus_test.TestSetReportCallerRace.func1()
/home/georlav/other/logrus/logger.go:216 +0x81
Previous write at 0x000000c75b98 by goroutine 7:
github.com/sirupsen/logrus.getCaller.func1()
/home/georlav/other/logrus/entry.go:170 +0xe1
sync.(*Once).Do()
/snap/go/3318/src/sync/once.go:44 +0xde
github.com/sirupsen/logrus.getCaller()
/home/georlav/other/logrus/entry.go:165 +0x149
github.com/sirupsen/logrus.Entry.log()
/home/georlav/other/logrus/entry.go:210 +0x395
github.com/sirupsen/logrus.(*Entry).Log()
/home/georlav/other/logrus/entry.go:258 +0x154
github.com/sirupsen/logrus.(*Logger).Log()
/home/georlav/other/logrus/logger.go:184 +0xa4
github.com/sirupsen/logrus_test.TestSetReportCallerRace.func1()
/home/georlav/other/logrus/logger.go:216 +0x81
The text was updated successfully, but these errors were encountered: