File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
opentelemetry-appender-tracing/src Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,12 @@ impl<LR: LogRecord> tracing::field::Visit for EventVisitor<'_, LR> {
121121 if is_duplicated_metadata ( field. name ( ) ) {
122122 return ;
123123 }
124- match i64:: try_from ( value) {
125- Ok ( signed) => {
126- self . log_record
127- . add_attribute ( Key :: new ( field. name ( ) ) , AnyValue :: from ( signed) ) ;
128- }
129- Err ( _) => {
130- self . log_record
131- . add_attribute ( Key :: new ( field. name ( ) ) , AnyValue :: from ( format ! ( "{value:?}" ) ) ) ;
132- }
124+ if let Ok ( signed) = i64:: try_from ( value) {
125+ self . log_record
126+ . add_attribute ( Key :: new ( field. name ( ) ) , AnyValue :: from ( signed) ) ;
127+ } else {
128+ self . log_record
129+ . add_attribute ( Key :: new ( field. name ( ) ) , AnyValue :: from ( format ! ( "{value:?}" ) ) ) ;
133130 }
134131 }
135132
You can’t perform that action at this time.
0 commit comments