Make some fields in LogRecord
mutable for consistency with Activity
.
#2877
Labels
enhancement
New feature or request
Feature Request
Currently, in
Activity
, there are methods that allowed users to modify the fields. For example:public Activity SetTag(string key, object? value)
.I'm proposing to introduce methods that allow some fields in
LogRecord
to be mutable - for better consistency withActivity
. Also, with this, use cases like redaction or fault-injection in Processor or Exporter could be achieved.Describe the solution you'd like:
Introduce setter methods to
FormattedMessage
,State
, andStateValues
.Describe alternatives you've considered.
Making the constructor public to provide users the ability to copy/update fields of their liking.
I think the public setters solution above has better encapsulation based on the OOP principles.
And for use cases like redaction or fault-injection, initialization is not mandatory for modifying a
LogRecord
.The text was updated successfully, but these errors were encountered: