Skip to content

Commit

Permalink
Use empty resource when RecordFactory.Resource nil
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Apr 25, 2024
1 parent 19ee6d4 commit fab2296
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/log/logtest/factory.go
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 fab2296

Please sign in to comment.