@@ -217,7 +217,7 @@ pub(crate) type FormatFn = Box<dyn RecordFormat + Sync + Send>;
217217
218218#[ derive( Default ) ]
219219pub ( crate ) struct Builder {
220- pub ( crate ) default_format : DefaultFormat ,
220+ pub ( crate ) default_format : ConfigurableFormat ,
221221 pub ( crate ) custom_format : Option < FormatFn > ,
222222 built : bool ,
223223}
@@ -279,7 +279,7 @@ type StyledValue<T> = T;
279279/// The default format.
280280///
281281/// This format needs to work with any combination of crate features.
282- pub ( crate ) struct DefaultFormat {
282+ pub ( crate ) struct ConfigurableFormat {
283283 pub ( crate ) timestamp : Option < TimestampPrecision > ,
284284 pub ( crate ) module_path : bool ,
285285 pub ( crate ) target : bool ,
@@ -292,7 +292,7 @@ pub(crate) struct DefaultFormat {
292292 pub ( crate ) kv_format : Option < Box < KvFormatFn > > ,
293293}
294294
295- impl DefaultFormat {
295+ impl ConfigurableFormat {
296296 /// Whether or not to write the level in the default format.
297297 pub ( crate ) fn level ( & mut self , write : bool ) -> & mut Self {
298298 self . level = write;
@@ -364,7 +364,7 @@ impl DefaultFormat {
364364 }
365365}
366366
367- impl Default for DefaultFormat {
367+ impl Default for ConfigurableFormat {
368368 fn default ( ) -> Self {
369369 Self {
370370 timestamp : Some ( Default :: default ( ) ) ,
@@ -381,9 +381,9 @@ impl Default for DefaultFormat {
381381 }
382382}
383383
384- impl RecordFormat for DefaultFormat {
384+ impl RecordFormat for ConfigurableFormat {
385385 fn format ( & self , formatter : & mut Formatter , record : & Record < ' _ > ) -> io:: Result < ( ) > {
386- let fmt = DefaultFormatWriter {
386+ let fmt = ConfigurableFormatWriter {
387387 format : self ,
388388 buf : formatter,
389389 written_header_value : false ,
@@ -396,13 +396,13 @@ impl RecordFormat for DefaultFormat {
396396/// The default format.
397397///
398398/// This format needs to work with any combination of crate features.
399- struct DefaultFormatWriter < ' a > {
400- format : & ' a DefaultFormat ,
399+ struct ConfigurableFormatWriter < ' a > {
400+ format : & ' a ConfigurableFormat ,
401401 buf : & ' a mut Formatter ,
402402 written_header_value : bool ,
403403}
404404
405- impl DefaultFormatWriter < ' _ > {
405+ impl ConfigurableFormatWriter < ' _ > {
406406 fn write ( mut self , record : & Record < ' _ > ) -> io:: Result < ( ) > {
407407 self . write_timestamp ( ) ?;
408408 self . write_level ( record) ?;
@@ -556,7 +556,7 @@ impl DefaultFormatWriter<'_> {
556556 // Create a wrapper around the buffer only if we have to actually indent the message
557557
558558 struct IndentWrapper < ' a , ' b > {
559- fmt : & ' a mut DefaultFormatWriter < ' b > ,
559+ fmt : & ' a mut ConfigurableFormatWriter < ' b > ,
560560 indent_count : usize ,
561561 }
562562
@@ -616,7 +616,7 @@ mod tests {
616616
617617 use log:: { Level , Record } ;
618618
619- fn write_record ( record : Record < ' _ > , fmt : DefaultFormatWriter < ' _ > ) -> String {
619+ fn write_record ( record : Record < ' _ > , fmt : ConfigurableFormatWriter < ' _ > ) -> String {
620620 let buf = fmt. buf . buf . clone ( ) ;
621621
622622 fmt. write ( & record) . expect ( "failed to write record" ) ;
@@ -625,7 +625,7 @@ mod tests {
625625 String :: from_utf8 ( buf. as_bytes ( ) . to_vec ( ) ) . expect ( "failed to read record" )
626626 }
627627
628- fn write_target ( target : & str , fmt : DefaultFormatWriter < ' _ > ) -> String {
628+ fn write_target ( target : & str , fmt : ConfigurableFormatWriter < ' _ > ) -> String {
629629 write_record (
630630 Record :: builder ( )
631631 . args ( format_args ! ( "log\n message" ) )
@@ -639,7 +639,7 @@ mod tests {
639639 )
640640 }
641641
642- fn write ( fmt : DefaultFormatWriter < ' _ > ) -> String {
642+ fn write ( fmt : ConfigurableFormatWriter < ' _ > ) -> String {
643643 write_target ( "" , fmt)
644644 }
645645
@@ -655,8 +655,8 @@ mod tests {
655655 fn format_with_header ( ) {
656656 let mut f = formatter ( ) ;
657657
658- let written = write ( DefaultFormatWriter {
659- format : & DefaultFormat {
658+ let written = write ( ConfigurableFormatWriter {
659+ format : & ConfigurableFormat {
660660 timestamp : None ,
661661 module_path : true ,
662662 target : false ,
@@ -679,8 +679,8 @@ mod tests {
679679 fn format_no_header ( ) {
680680 let mut f = formatter ( ) ;
681681
682- let written = write ( DefaultFormatWriter {
683- format : & DefaultFormat {
682+ let written = write ( ConfigurableFormatWriter {
683+ format : & ConfigurableFormat {
684684 timestamp : None ,
685685 module_path : false ,
686686 target : false ,
@@ -703,8 +703,8 @@ mod tests {
703703 fn format_indent_spaces ( ) {
704704 let mut f = formatter ( ) ;
705705
706- let written = write ( DefaultFormatWriter {
707- format : & DefaultFormat {
706+ let written = write ( ConfigurableFormatWriter {
707+ format : & ConfigurableFormat {
708708 timestamp : None ,
709709 module_path : true ,
710710 target : false ,
@@ -727,8 +727,8 @@ mod tests {
727727 fn format_indent_zero_spaces ( ) {
728728 let mut f = formatter ( ) ;
729729
730- let written = write ( DefaultFormatWriter {
731- format : & DefaultFormat {
730+ let written = write ( ConfigurableFormatWriter {
731+ format : & ConfigurableFormat {
732732 timestamp : None ,
733733 module_path : true ,
734734 target : false ,
@@ -751,8 +751,8 @@ mod tests {
751751 fn format_indent_spaces_no_header ( ) {
752752 let mut f = formatter ( ) ;
753753
754- let written = write ( DefaultFormatWriter {
755- format : & DefaultFormat {
754+ let written = write ( ConfigurableFormatWriter {
755+ format : & ConfigurableFormat {
756756 timestamp : None ,
757757 module_path : false ,
758758 target : false ,
@@ -775,8 +775,8 @@ mod tests {
775775 fn format_suffix ( ) {
776776 let mut f = formatter ( ) ;
777777
778- let written = write ( DefaultFormatWriter {
779- format : & DefaultFormat {
778+ let written = write ( ConfigurableFormatWriter {
779+ format : & ConfigurableFormat {
780780 timestamp : None ,
781781 module_path : false ,
782782 target : false ,
@@ -799,8 +799,8 @@ mod tests {
799799 fn format_suffix_with_indent ( ) {
800800 let mut f = formatter ( ) ;
801801
802- let written = write ( DefaultFormatWriter {
803- format : & DefaultFormat {
802+ let written = write ( ConfigurableFormatWriter {
803+ format : & ConfigurableFormat {
804804 timestamp : None ,
805805 module_path : false ,
806806 target : false ,
@@ -825,8 +825,8 @@ mod tests {
825825
826826 let written = write_target (
827827 "target" ,
828- DefaultFormatWriter {
829- format : & DefaultFormat {
828+ ConfigurableFormatWriter {
829+ format : & ConfigurableFormat {
830830 timestamp : None ,
831831 module_path : true ,
832832 target : true ,
@@ -850,8 +850,8 @@ mod tests {
850850 fn format_empty_target ( ) {
851851 let mut f = formatter ( ) ;
852852
853- let written = write ( DefaultFormatWriter {
854- format : & DefaultFormat {
853+ let written = write ( ConfigurableFormatWriter {
854+ format : & ConfigurableFormat {
855855 timestamp : None ,
856856 module_path : true ,
857857 target : true ,
@@ -876,8 +876,8 @@ mod tests {
876876
877877 let written = write_target (
878878 "target" ,
879- DefaultFormatWriter {
880- format : & DefaultFormat {
879+ ConfigurableFormatWriter {
880+ format : & ConfigurableFormat {
881881 timestamp : None ,
882882 module_path : true ,
883883 target : false ,
@@ -901,8 +901,8 @@ mod tests {
901901 fn format_with_source_file_and_line_number ( ) {
902902 let mut f = formatter ( ) ;
903903
904- let written = write ( DefaultFormatWriter {
905- format : & DefaultFormat {
904+ let written = write ( ConfigurableFormatWriter {
905+ format : & ConfigurableFormat {
906906 timestamp : None ,
907907 module_path : false ,
908908 target : false ,
@@ -935,8 +935,8 @@ mod tests {
935935
936936 let written = write_record (
937937 record,
938- DefaultFormatWriter {
939- format : & DefaultFormat {
938+ ConfigurableFormatWriter {
939+ format : & ConfigurableFormat {
940940 timestamp : None ,
941941 module_path : false ,
942942 target : false ,
@@ -972,8 +972,8 @@ mod tests {
972972
973973 let written = write_record (
974974 record,
975- DefaultFormatWriter {
976- format : & DefaultFormat {
975+ ConfigurableFormatWriter {
976+ format : & ConfigurableFormat {
977977 timestamp : None ,
978978 module_path : true ,
979979 target : true ,
0 commit comments