@@ -662,6 +662,35 @@ Formatter Objects
662
662
:func: `traceback.print_stack `, but with the last newline removed) as a
663
663
string. This default implementation just returns the input value.
664
664
665
+ .. class :: BufferingFormatter(linefmt=None)
666
+
667
+ A base formatter class suitable for subclassing when you want to format a
668
+ number of records. You can pass a :class: `Formatter ` instance which you want
669
+ to use to format each line (that corresponds to a single record). If not
670
+ specified, the default formatter (which just outputs the event message) is
671
+ used as the line formatter.
672
+
673
+ .. method :: formatHeader(records)
674
+
675
+ Return a header for a list of *records *. The base implementation just
676
+ returns the empty string. You will need to override this method if you
677
+ want specific behaviour, e.g. to show the count of records, a title or a
678
+ separator line.
679
+
680
+ .. method :: formatFooter(records)
681
+
682
+ Return a footer for a list of *records *. The base implementation just
683
+ returns the empty string. You will need to override this method if you
684
+ want specific behaviour, e.g. to show the count of records or a separator
685
+ line.
686
+
687
+ .. method :: format(records)
688
+
689
+ Return formatted text for a list of *records *. The base implementation
690
+ just returns the empty string if there are no records; otherwise, it
691
+ returns the concatenation of the header, each record formatted with the
692
+ line formatter, and the footer.
693
+
665
694
.. _filter :
666
695
667
696
Filter Objects
0 commit comments