From cd5ba78c6f174fbdfddda6f7c382021b5b491274 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Fri, 17 Jun 2022 10:52:55 -0400 Subject: [PATCH 1/2] core: add support for recording 128-bit ints (signed and unsigned) --- tracing-core/src/field.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index 651064b156..99818848ea 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -194,6 +194,16 @@ pub trait Visit { self.record_debug(field, &value) } + /// Visit a signed 128-bit integer value. + fn record_i128(&mut self, field: &Field, value: i128) { + self.record_debug(field, &value) + } + + /// Visit an unsigned 128-bit integer value. + fn record_u128(&mut self, field: &Field, value: u128) { + self.record_debug(field, &value) + } + /// Visit a boolean value. fn record_bool(&mut self, field: &Field, value: bool) { self.record_debug(field, &value) @@ -393,6 +403,8 @@ impl_values! { record_u64(usize, u32, u16, u8 as u64), record_i64(i64), record_i64(isize, i32, i16, i8 as i64), + record_u128(u128), + record_i128(i128), record_bool(bool), record_f64(f64, f32 as f64) } From 34ac117f193ff55fdaabb03320d2437c6fc6968e Mon Sep 17 00:00:00 2001 From: David Barsky Date: Fri, 17 Jun 2022 16:50:20 -0400 Subject: [PATCH 2/2] docs --- tracing-core/src/field.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index 99818848ea..cb02eb7e01 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -16,9 +16,9 @@ //! will contain any fields attached to each event. //! //! `tracing` represents values as either one of a set of Rust primitives -//! (`i64`, `u64`, `f64`, `bool`, and `&str`) or using a `fmt::Display` or -//! `fmt::Debug` implementation. Collectors are provided these primitive -//! value types as `dyn Value` trait objects. +//! (`i64`, `u64`, `f64`, `i128`, `u128`, `bool`, and `&str`) or using a +//! `fmt::Display` or `fmt::Debug` implementation. Collectors are provided +//! these primitive value types as `dyn Value` trait objects. //! //! These trait objects can be formatted using `fmt::Debug`, but may also be //! recorded as typed data by calling the [`Value::record`] method on these