Skip to content

Commit

Permalink
Add usage doc comment for AnyValue type (#2293)
Browse files Browse the repository at this point in the history
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
  • Loading branch information
lalitb and cijothomas authored Nov 8, 2024
1 parent 845cf21 commit 0cc2cd5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opentelemetry/src/logs/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ pub trait LogRecord {
}

/// Value types for representing arbitrary values in a log record.
/// Note: The `tracing` and `log` crates only support basic types that can be
/// converted to these core variants: `i64`, `f64`, `StringValue`, and `bool`.
/// Any complex and custom types are supported through their Debug implementation,
/// and converted to String. More complex types (`Bytes`, `ListAny`, and `Map`) are
/// included here to meet specification requirements and are available to support
/// custom appenders that may be implemented for other logging crates.
/// These types allow for handling dynamic data structures, so keep in mind the
/// potential performance overhead of using boxed vectors and maps in appenders.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum AnyValue {
Expand Down

0 comments on commit 0cc2cd5

Please sign in to comment.