diff --git a/core.go b/core.go index 0786670..6199aed 100644 --- a/core.go +++ b/core.go @@ -139,7 +139,7 @@ func (c *core) Write(ent zapcore.Entry, fs []zapcore.Field) error { clone := c.with(c.addSpecialFields(ent, fs)) // only when we have local sentryScope to avoid collecting all breadcrumbs ever in a global scope - if c.cfg.EnableBreadcrumbs && c.cfg.BreadcrumbLevel.Enabled(ent.Level) && c.sentryScope != nil { + if c.cfg.EnableBreadcrumbs && c.cfg.BreadcrumbLevel.Enabled(ent.Level) && c.scope() != nil { breadcrumb := sentry.Breadcrumb{ Message: ent.Message, Data: clone.fields, @@ -147,7 +147,7 @@ func (c *core) Write(ent zapcore.Entry, fs []zapcore.Field) error { Timestamp: ent.Time, } - c.sentryScope.AddBreadcrumb(&breadcrumb, c.cfg.MaxBreadcrumbs) + c.scope().AddBreadcrumb(&breadcrumb, c.cfg.MaxBreadcrumbs) } if c.cfg.Level.Enabled(ent.Level) {