Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add support for recording 128-bit integers #2166

Merged
merged 2 commits into from
Jun 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
davidbarsky marked this conversation as resolved.
Show resolved Hide resolved

/// Visit a boolean value.
fn record_bool(&mut self, field: &Field, value: bool) {
self.record_debug(field, &value)
Expand Down Expand Up @@ -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)
}
Expand Down