Add bind-style context helpers

This commit is contained in:
Nanaloveyuki
2026-05-10 12:12:11 +08:00
parent 2e008b649c
commit a26ec6399c
9 changed files with 86 additions and 0 deletions
+6
View File
@@ -7,6 +7,12 @@ pub fn field(key : String, value : String) -> Field {
{ key, value }
}
pub fn fields(entries : Array[(String, String)]) -> Array[Field] {
entries.map(fn(entry) {
field(entry.0, entry.1)
})
}
pub struct Record {
level : Level
timestamp_ms : UInt64