@@ -276,10 +276,9 @@ impl<T: Display> Display for StyledValue<T> {
276
276
#[ cfg( not( feature = "color" ) ) ]
277
277
type StyledValue < T > = T ;
278
278
279
- /// The default format.
280
- ///
281
- /// This format needs to work with any combination of crate features.
282
- pub ( crate ) struct ConfigurableFormat {
279
+ /// A [custom format][crate::Builder::format] with settings for which fields to show
280
+ pub struct ConfigurableFormat {
281
+ // This format needs to work with any combination of crate features.
283
282
pub ( crate ) timestamp : Option < TimestampPrecision > ,
284
283
pub ( crate ) module_path : bool ,
285
284
pub ( crate ) target : bool ,
@@ -294,7 +293,7 @@ pub(crate) struct ConfigurableFormat {
294
293
295
294
impl ConfigurableFormat {
296
295
/// Format the [`Record`] as configured for outputting
297
- pub ( crate ) fn format ( & self , formatter : & mut Formatter , record : & Record < ' _ > ) -> io:: Result < ( ) > {
296
+ pub fn format ( & self , formatter : & mut Formatter , record : & Record < ' _ > ) -> io:: Result < ( ) > {
298
297
let fmt = ConfigurableFormatWriter {
299
298
format : self ,
300
299
buf : formatter,
@@ -307,52 +306,52 @@ impl ConfigurableFormat {
307
306
308
307
impl ConfigurableFormat {
309
308
/// Whether or not to write the level in the default format.
310
- pub ( crate ) fn level ( & mut self , write : bool ) -> & mut Self {
309
+ pub fn level ( & mut self , write : bool ) -> & mut Self {
311
310
self . level = write;
312
311
self
313
312
}
314
313
315
314
/// Whether or not to write the source file path in the default format.
316
- pub ( crate ) fn file ( & mut self , write : bool ) -> & mut Self {
315
+ pub fn file ( & mut self , write : bool ) -> & mut Self {
317
316
self . source_file = write;
318
317
self
319
318
}
320
319
321
320
/// Whether or not to write the source line number path in the default format.
322
321
///
323
322
/// Only has effect if `format_file` is also enabled
324
- pub ( crate ) fn line_number ( & mut self , write : bool ) -> & mut Self {
323
+ pub fn line_number ( & mut self , write : bool ) -> & mut Self {
325
324
self . source_line_number = write;
326
325
self
327
326
}
328
327
329
328
/// Whether or not to write the module path in the default format.
330
- pub ( crate ) fn module_path ( & mut self , write : bool ) -> & mut Self {
329
+ pub fn module_path ( & mut self , write : bool ) -> & mut Self {
331
330
self . module_path = write;
332
331
self
333
332
}
334
333
335
334
/// Whether or not to write the target in the default format.
336
- pub ( crate ) fn target ( & mut self , write : bool ) -> & mut Self {
335
+ pub fn target ( & mut self , write : bool ) -> & mut Self {
337
336
self . target = write;
338
337
self
339
338
}
340
339
341
340
/// Configures the amount of spaces to use to indent multiline log records.
342
341
/// A value of `None` disables any kind of indentation.
343
- pub ( crate ) fn indent ( & mut self , indent : Option < usize > ) -> & mut Self {
342
+ pub fn indent ( & mut self , indent : Option < usize > ) -> & mut Self {
344
343
self . indent = indent;
345
344
self
346
345
}
347
346
348
347
/// Configures if timestamp should be included and in what precision.
349
- pub ( crate ) fn timestamp ( & mut self , timestamp : Option < TimestampPrecision > ) -> & mut Self {
348
+ pub fn timestamp ( & mut self , timestamp : Option < TimestampPrecision > ) -> & mut Self {
350
349
self . timestamp = timestamp;
351
350
self
352
351
}
353
352
354
353
/// Configures the end of line suffix.
355
- pub ( crate ) fn suffix ( & mut self , suffix : & ' static str ) -> & mut Self {
354
+ pub fn suffix ( & mut self , suffix : & ' static str ) -> & mut Self {
356
355
self . suffix = suffix;
357
356
self
358
357
}
@@ -368,7 +367,7 @@ impl ConfigurableFormat {
368
367
/// The default format uses a space to separate each key-value pair, with an "=" between
369
368
/// the key and value.
370
369
#[ cfg( feature = "kv" ) ]
371
- pub ( crate ) fn key_values < F > ( & mut self , format : F ) -> & mut Self
370
+ pub fn key_values < F > ( & mut self , format : F ) -> & mut Self
372
371
where
373
372
F : Fn ( & mut Formatter , & dyn log:: kv:: Source ) -> io:: Result < ( ) > + Sync + Send + ' static ,
374
373
{
0 commit comments