Support construction of Records and Metadata #116
Labels
No labels
bug
duplicate
easy
enhancement
help wanted
invalid
question
rfc
structured-logging
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-rust-lang/log#116
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Testing and "shim loggers" typically want to do this so we should support these constructions! We probably want to have the construction go through builders to ensure that we can flexibly add more fields in the future.
I'm not tagging this issue as "easy" just yet as it's got some API design involved, but if we get a concrete design listed here I think it'd be great to tag this issue as "easy" afterwards for an implementation to come by.
@alexcrichton Since
LogRecordandLogMetadatawere renamed, could you edit the title and replace:By:
It's not really important, but I think it may confuse users (including me!).
Fixed!
I'll begin working on this!
RecordBuilderandMetadataBuilderstructsimplthe following setters forMetadataBuilder:level()andtarget()implthe following setters forRecordBuilder:args(),metadata(),location()implabuild()method for eachBuilderand returns aRecordor aMetadataLook ok?
@omh1280 that looks reasonable to me. Methods should probably take
&mut self.I'm not sure how to give an example for creating a
Location. It's accessible (pub), but it's hidden from the docs and I think giving an example using it would be a bad decision. It's also a necessary part of constructing a fullRecord.Does
Locationneed a builder, too?Yep
I've submitted a PR for this!
Thanks @omh1280! Sorry for the delay 👍