Skip to content

Commit

Permalink
Use empty resource when RecordFactory.Resource nil (#5264)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored Apr 28, 2024
1 parent c9c1503 commit 9794825
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/log/logtest/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ func (b RecordFactory) NewRecord() sdklog.Record {
attributeCountLimit = len(b.Attributes)
}

res := b.Resource
if res == nil {
res = resource.Empty()
}

provider := sdklog.NewLoggerProvider(
sdklog.WithResource(b.Resource),
sdklog.WithResource(res),
sdklog.WithAttributeCountLimit(attributeCountLimit),
sdklog.WithAttributeValueLengthLimit(-1),
sdklog.WithProcessor(p),
Expand Down

0 comments on commit 9794825

Please sign in to comment.