Implements the interface ObjectConverter. Class TextLogger creates an instance of this type in the moment no other (custom) type was set prior to the first log statement.
This implementation uses two specialisations of class Formatter to format the given logables to a textual representation. The formatters (and their sequence!) are:
This way, standard text logging supports format strings in Python style as well as in Java style.
Public Fields | |
FormatterJavaStyle | FormatterJS |
FormatterPythonStyle | FormatterPS |
Public Methods | |
StandardConverter () | |
override void | ConvertObjects (AString target, List< Object > logables) |
override AutoSizes | GetAutoSizes () |
override void | ResetAutoSizes () |
Protected Fields | |
int | cntRecursion = 0 |
List< FormatterPythonStyle > | recursionFormatters = new List<FormatterPythonStyle>() |
|
inline |
Constructor.
|
inlinevirtual |
The conversion method. Passes target and logables to FormatterPS.
target | An AString that takes the result. |
logables | The objects to convert. |
Implements ObjectConverter.
|
inlinevirtual |
Returns a pointer to the auto sizes object of the formatter FormatterPS.
Implements ObjectConverter.
|
inlinevirtual |
Resets automatically widened tab stops and field widths of this converter.
Implements ObjectConverter.
|
protected |
A counter to detect recursive calls.
FormatterJavaStyle FormatterJS |
Formatter to process Java style format strings. Attached to FormatterPS as second format option.
FormatterPythonStyle FormatterPS |
Formatter to process python style format strings. Used as the first (main) formatter.
|
protected |
Formatters used with recursive calls log calls. If recursion occurs, the formatters are created, respectively re-used from last time and their settings are reset to those of the main formatters.