@@ -5,7 +5,7 @@ use super::WriteStyle;
55use super :: { Formatter , StyledValue } ;
66#[ cfg( feature = "color" ) ]
77use anstyle:: Style ;
8- use log:: kv:: { source :: Source , Error , Key , Value , Visitor } ;
8+ use log:: kv:: { Error , Key , Source , Value , VisitSource } ;
99
1010/// Format function for serializing key/value pairs
1111///
@@ -35,22 +35,20 @@ pub fn hidden_kv_format(_formatter: &mut Formatter, _fields: &dyn Source) -> io:
3535/// For example: `ip=127.0.0.1 port=123456 path=/example`
3636pub fn default_kv_format ( formatter : & mut Formatter , fields : & dyn Source ) -> io:: Result < ( ) > {
3737 fields
38- . visit ( & mut DefaultVisitor ( formatter) )
38+ . visit ( & mut DefaultVisitSource ( formatter) )
3939 . map_err ( |e| io:: Error :: new ( io:: ErrorKind :: Other , e) )
4040}
4141
42- struct DefaultVisitor < ' a > ( & ' a mut Formatter ) ;
42+ struct DefaultVisitSource < ' a > ( & ' a mut Formatter ) ;
4343
44- impl < ' a , ' kvs > Visitor < ' kvs > for DefaultVisitor < ' a > {
44+ impl < ' a , ' kvs > VisitSource < ' kvs > for DefaultVisitSource < ' a > {
4545 fn visit_pair ( & mut self , key : Key , value : Value < ' kvs > ) -> Result < ( ) , Error > {
46- // TODO: add styling
47- // tracing-subscriber uses italic for the key and dimmed for the =
4846 write ! ( self . 0 , " {}={}" , self . style_key( key) , value) ?;
4947 Ok ( ( ) )
5048 }
5149}
5250
53- impl DefaultVisitor < ' _ > {
51+ impl DefaultVisitSource < ' _ > {
5452 fn style_key < ' k > ( & self , text : Key < ' k > ) -> StyledValue < Key < ' k > > {
5553 #[ cfg( feature = "color" ) ]
5654 {
0 commit comments