3434//!
3535//! # Key Value arguments
3636//!
37- //! If the `unstable- kv` feature is enabled, then the default format will include key values from
37+ //! If the `kv` feature is enabled, then the default format will include key values from
3838//! the log by default, but this can be disabled by calling [`Builder::format_key_values`]
3939//! with [`hidden_kv_format`] as the format function.
4040//!
4141//! The way these keys and values are formatted can also be customized with a separate format
4242//! function that is called by the default format with [`Builder::format_key_values`].
4343//!
4444//! ```
45- //! # #[cfg(feature= "unstable- kv")]
45+ //! # #[cfg(feature= "kv")]
4646//! # {
4747//! use log::info;
4848//! env_logger::init();
@@ -69,7 +69,7 @@ use log::Record;
6969
7070#[ cfg( feature = "humantime" ) ]
7171mod humantime;
72- #[ cfg( feature = "unstable- kv" ) ]
72+ #[ cfg( feature = "kv" ) ]
7373mod kv;
7474pub ( crate ) mod writer;
7575
@@ -78,7 +78,7 @@ pub use anstyle as style;
7878
7979#[ cfg( feature = "humantime" ) ]
8080pub use self :: humantime:: Timestamp ;
81- #[ cfg( feature = "unstable- kv" ) ]
81+ #[ cfg( feature = "kv" ) ]
8282pub use self :: kv:: * ;
8383pub use self :: writer:: Target ;
8484pub use self :: writer:: WriteStyle ;
@@ -212,7 +212,7 @@ pub(crate) struct Builder {
212212 pub ( crate ) format_suffix : & ' static str ,
213213 pub ( crate ) format_file : bool ,
214214 pub ( crate ) format_line_number : bool ,
215- #[ cfg( feature = "unstable- kv" ) ]
215+ #[ cfg( feature = "kv" ) ]
216216 pub ( crate ) kv_format : Option < Box < KvFormatFn > > ,
217217 built : bool ,
218218}
@@ -248,7 +248,7 @@ impl Builder {
248248 suffix : built. format_suffix ,
249249 source_file : built. format_file ,
250250 source_line_number : built. format_line_number ,
251- #[ cfg( feature = "unstable- kv" ) ]
251+ #[ cfg( feature = "kv" ) ]
252252 kv_format : built. kv_format . as_deref ( ) . unwrap_or ( & default_kv_format) ,
253253 buf,
254254 } ;
@@ -271,7 +271,7 @@ impl Default for Builder {
271271 format_indent : Some ( 4 ) ,
272272 custom_format : None ,
273273 format_suffix : "\n " ,
274- #[ cfg( feature = "unstable- kv" ) ]
274+ #[ cfg( feature = "kv" ) ]
275275 kv_format : None ,
276276 built : false ,
277277 }
@@ -321,7 +321,7 @@ struct DefaultFormat<'a> {
321321 indent : Option < usize > ,
322322 buf : & ' a mut Formatter ,
323323 suffix : & ' a str ,
324- #[ cfg( feature = "unstable- kv" ) ]
324+ #[ cfg( feature = "kv" ) ]
325325 kv_format : & ' a KvFormatFn ,
326326}
327327
@@ -335,7 +335,7 @@ impl DefaultFormat<'_> {
335335 self . finish_header ( ) ?;
336336
337337 self . write_args ( record) ?;
338- #[ cfg( feature = "unstable- kv" ) ]
338+ #[ cfg( feature = "kv" ) ]
339339 self . write_kv ( record) ?;
340340 write ! ( self . buf, "{}" , self . suffix)
341341 }
@@ -518,7 +518,7 @@ impl DefaultFormat<'_> {
518518 }
519519 }
520520
521- #[ cfg( feature = "unstable- kv" ) ]
521+ #[ cfg( feature = "kv" ) ]
522522 fn write_kv ( & mut self , record : & Record < ' _ > ) -> io:: Result < ( ) > {
523523 let format = self . kv_format ;
524524 format ( self . buf , record. key_values ( ) )
@@ -577,7 +577,7 @@ mod tests {
577577 level : true ,
578578 source_file : false ,
579579 source_line_number : false ,
580- #[ cfg( feature = "unstable- kv" ) ]
580+ #[ cfg( feature = "kv" ) ]
581581 kv_format : & hidden_kv_format,
582582 written_header_value : false ,
583583 indent : None ,
@@ -599,7 +599,7 @@ mod tests {
599599 level : false ,
600600 source_file : false ,
601601 source_line_number : false ,
602- #[ cfg( feature = "unstable- kv" ) ]
602+ #[ cfg( feature = "kv" ) ]
603603 kv_format : & hidden_kv_format,
604604 written_header_value : false ,
605605 indent : None ,
@@ -621,7 +621,7 @@ mod tests {
621621 level : true ,
622622 source_file : false ,
623623 source_line_number : false ,
624- #[ cfg( feature = "unstable- kv" ) ]
624+ #[ cfg( feature = "kv" ) ]
625625 kv_format : & hidden_kv_format,
626626 written_header_value : false ,
627627 indent : Some ( 4 ) ,
@@ -643,7 +643,7 @@ mod tests {
643643 level : true ,
644644 source_file : false ,
645645 source_line_number : false ,
646- #[ cfg( feature = "unstable- kv" ) ]
646+ #[ cfg( feature = "kv" ) ]
647647 kv_format : & hidden_kv_format,
648648 written_header_value : false ,
649649 indent : Some ( 0 ) ,
@@ -665,7 +665,7 @@ mod tests {
665665 level : false ,
666666 source_file : false ,
667667 source_line_number : false ,
668- #[ cfg( feature = "unstable- kv" ) ]
668+ #[ cfg( feature = "kv" ) ]
669669 kv_format : & hidden_kv_format,
670670 written_header_value : false ,
671671 indent : Some ( 4 ) ,
@@ -687,7 +687,7 @@ mod tests {
687687 level : false ,
688688 source_file : false ,
689689 source_line_number : false ,
690- #[ cfg( feature = "unstable- kv" ) ]
690+ #[ cfg( feature = "kv" ) ]
691691 kv_format : & hidden_kv_format,
692692 written_header_value : false ,
693693 indent : None ,
@@ -709,7 +709,7 @@ mod tests {
709709 level : false ,
710710 source_file : false ,
711711 source_line_number : false ,
712- #[ cfg( feature = "unstable- kv" ) ]
712+ #[ cfg( feature = "kv" ) ]
713713 kv_format : & hidden_kv_format,
714714 written_header_value : false ,
715715 indent : Some ( 4 ) ,
@@ -733,7 +733,7 @@ mod tests {
733733 level : true ,
734734 source_file : false ,
735735 source_line_number : false ,
736- #[ cfg( feature = "unstable- kv" ) ]
736+ #[ cfg( feature = "kv" ) ]
737737 kv_format : & hidden_kv_format,
738738 written_header_value : false ,
739739 indent : None ,
@@ -756,7 +756,7 @@ mod tests {
756756 level : true ,
757757 source_file : false ,
758758 source_line_number : false ,
759- #[ cfg( feature = "unstable- kv" ) ]
759+ #[ cfg( feature = "kv" ) ]
760760 kv_format : & hidden_kv_format,
761761 written_header_value : false ,
762762 indent : None ,
@@ -780,7 +780,7 @@ mod tests {
780780 level : true ,
781781 source_file : false ,
782782 source_line_number : false ,
783- #[ cfg( feature = "unstable- kv" ) ]
783+ #[ cfg( feature = "kv" ) ]
784784 kv_format : & hidden_kv_format,
785785 written_header_value : false ,
786786 indent : None ,
@@ -803,7 +803,7 @@ mod tests {
803803 level : true ,
804804 source_file : true ,
805805 source_line_number : true ,
806- #[ cfg( feature = "unstable- kv" ) ]
806+ #[ cfg( feature = "kv" ) ]
807807 kv_format : & hidden_kv_format,
808808 written_header_value : false ,
809809 indent : None ,
@@ -814,7 +814,7 @@ mod tests {
814814 assert_eq ! ( "[INFO test.rs:144] log\n message\n " , written) ;
815815 }
816816
817- #[ cfg( feature = "unstable- kv" ) ]
817+ #[ cfg( feature = "kv" ) ]
818818 #[ test]
819819 fn format_kv_default ( ) {
820820 let kvs = & [ ( "a" , 1u32 ) , ( "b" , 2u32 ) ] [ ..] ;
@@ -846,7 +846,7 @@ mod tests {
846846 assert_eq ! ( "[INFO ] log message a=1 b=2\n " , written) ;
847847 }
848848
849- #[ cfg( feature = "unstable- kv" ) ]
849+ #[ cfg( feature = "kv" ) ]
850850 #[ test]
851851 fn format_kv_default_full ( ) {
852852 let kvs = & [ ( "a" , 1u32 ) , ( "b" , 2u32 ) ] [ ..] ;
0 commit comments