Skip to content

Commit 35f7efd

Browse files
tomakadpc
authored andcommitted
Add as_record_values
1 parent 06b308f commit 35f7efd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,21 @@ impl AsyncRecord {
497497
&self.logger_values,
498498
)
499499
}
500+
501+
/// Deconstruct this `AsyncRecord` into a record and `OwnedKVList`.
502+
pub fn as_record_values(&self, mut f: impl FnMut(&Record, &OwnedKVList)) {
503+
let rs = RecordStatic {
504+
location: &*self.location,
505+
level: self.level,
506+
tag: &self.tag,
507+
};
508+
509+
f(&Record::new(
510+
&rs,
511+
&format_args!("{}", self.msg),
512+
BorrowedKV(&self.kv),
513+
), &self.logger_values)
514+
}
500515
}
501516

502517
enum AsyncMsg {

0 commit comments

Comments
 (0)