Open
Description
An Attributes.Make
equivalent could be helpful for product types we want to extract multiple attributes out of easily
case class Record(i: Int, s: String, c: MyType)
val record: Record = ???
implicit val makeMyType: Attribute.Make[MyType] = ???
implicit val attributesRecord: Attributes.Make[Record] =
new Attributes.Make { record =>
Attributes(List(... /* list of attributes for i, s, c fields */))
}
Trace[F].span("new-span", record).surround { ... }
Looks quite convenient, could also be quite useful structured logging, I'd like to wire this up to a log4cats wrapper.
Is there a more convenient way of deriving this that could be provided? Or can the existing Attribute.Make be wrangled to not need this